From: David G. <go...@py...> - 2018-06-04 15:17:32
|
On 4 June 2018 at 09:39, Erik Stein <st...@ma...> wrote: > > Hello -- > > I'm using docutils to semi-automatically construct certain content pages. > I've got the problem that sometimes people enter text which in the context > of a restructured text file has some semantical meaning, but this is not the > intention in the actual case. > > E.g. > > "v. l. Donald Trump, Kim Jong UN" > > where "v. l." means "from left to right" in a photo. > > Docutils interprets this as a roman numbered list (my guess, this is in the > context of a figure You are correct that Docutils is interpreting this text as a list. In fact, this specific text will be interpreted as two nested lowercase-alphabetic enumerated lists. > is there a (python) function in docutils which allows to escape a string in > a way that docutils simply renders it as text? There is no generic "escape all" function in Docutils. In many cases, simply prefixing a backslash to the text will escape it: $ rst2pseudoxml.py <<EOF > \v. l. a b c > > EOF <document source="<stdin>"> <paragraph> v. l. a b c David Goodger <http://python.net/~goodger> |