From: David G. <go...@py...> - 2002-12-11 01:24:40
|
David Ascher wrote: > Is there an option I don't know about to let docutils barrel through > and never raise an exception when processing a document? "Never" may not be possible, but "almost never" is. Use the "--halt none" option or ``settings.halt_level = 5``. Similarly for "--report" if you don't even want to *see* the warnings (which I don't recommend). > Where the ... is interpreted as a heading marker -- if I change the > "."'s to "1"'s, docutils has no problems. > > Note that while this is from an old PEP, I have other documents > which have the same idiom: > > # if unknown message -> do mime parsing, regex rules, eval tests, etc. > ... > > Maybe we could make ... a special case? It is already a special case, actually. A line of punctuation marks is recognized as a title underline if it is flush left and as long as the title text or longer. If the line of punctuation marks is shorter than the title text, but at least 4 characters long, it will be recognized as an underline but a warning is generated. If it is 3 characters long or shorter, it is *not* recognized as a title underline, and an info-level system message is generated. Info-level messages are normally filtered out of final output (use "--report" to adjust). To illustrate:: $ tools/publish.py << EOF > blahblah > ... > EOF <document source="<stdin>"> <system_message level="1" line="2" source="<stdin>" type="INFO"> <paragraph> Possible title underline, too short for the title. Treating it as ordinary text because it's so short. <paragraph> blahblah ... But then I tried your example, in which the "..." is indented in a block quote. You've discovered a bug in the parser. Expect a fix in a day or two. -- David Goodger <go...@py...> 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/ |