From: Jim Hefferon <ftpmaint@tu...> - 2008-05-11 17:25:08
I'm having trouble understanding why this
I understand that it is a strange construct but I am converting some old stuff
and this is what arises. I expect it to produce two adjacent inline literals.
Instead it seems to skip over the middle:
~/test$ cat rest.tst
~/test$ /usr/local/bin/rst2html.py rest.tst rest.html
~/test$ tail rest.html
<p>hello <tt class="docutils literal"><span
Are my expectations all wrong?
$ /usr/local/bin/rst2html.py --version rest.tst rest.html
rst2html.py (Docutils 0.5 [snapshot 2007-12-20, r5488])
[Jim Hefferon - 2008-05-11 13:14]
> I'm having trouble understanding why this
> isn't liked.
> I understand that it is a strange construct but I am converting some old stuff
> and this is what arises. I expect it to produce two adjacent inline literals.
> Instead it seems to skip over the middle:
That's because inline markup must begin and end with whitespace or certain
punctuation. In your example, the "first" inline literal, ``-``, is immediately
followed not by whitespace or accepted punctuation, but by more backquotes.
This prevents the backquotes at indexes 3 & 4 (0-based) from being recognized as
closing markup. Then next pair of backquotes, at indexes 5 & 6, are followed by
a hyphen, which is an accepted inline markup delimiter.
If you want two adjacent inline literals, you need to separate them. A space
If you don't want a space between them, use an escaped space:
The backslash (escaping character) is also accepted as a delimiter after closing
Or, even easier, just leave them as a single inline literal:
For details see
David Goodger <http://python.net/~goodger>