From: David G. <go...@us...> - 2002-07-11 02:00:42
|
[Adam] >>> So apparantly ``.. Inneh=C2ll::`` is recognized as a valid directive at >>> *some* level, but later turned into a comment instead. I haven't tried >>> finding out what's wrong, yet. [David] >> I haven't had a chance to look at the code, and I won't for a few days (= we >> have visitors), but I do have an idea. Probably, the directive-detectin= g >> regular expression is checking for a "simple name" which is alphanumeric= s >> plus "-", "_", and ".". "Alphanumerics" is probably limited to >> "[a-zA-Z0-9]", and should be expanded to cover the locale's idea of what >> letters should be, including accents. The "=C2" in "Inneh=C2ll" is probably >> throwing it off. [Adam] > I still haven't had time to investigate further, but it struck me > that using the current locale for this simply won't work: it needs > to be determined from the language (that docutils gets with > --language). The reason is in server / build environments where you > need to build the docs correctly in a multitud of different > languages, when the locale will probably be "C". So this needs to be > controlled in some language file, I think. Or we can just use "\w" in regexes, combined with re.UNICODE. That way, *all* alphanumerics in Unicode, no matter what language, will be matched. It's a bit tricky, since "\w" is defined as "[a-zA-Z0-9_]" (plus lots more, for Unicode), and sometimes we don't want the "[0-9_]". I'll give it a try. ... Done; see the latest CVS. > On the subject of languages, how about adding a directive (or > bibliographic field) for specyfying the language used by the > document? I'm not sure if a bibliographic field is appropriate. The directive idea is already in the To Do list (where it will stay until someone wants it enough). Patches are always welcome! --=20 David Goodger <go...@us...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |