python-textile icon indicating copy to clipboard operation
python-textile copied to clipboard

Footnote references are not resolved unless put after letter

Open Mekk opened this issue 12 years ago • 1 comments

>>> import textile

This is OK:

>>> textile.textile("Ala ma kota[1]")
'\t<p>Ala ma kota<sup class="footnote"><a href="#fn217a423d-2aca-4b3b-b18d-65cfc5cf4022">1</a></sup></p>'

But this is not:

>>> textile.textile("Ala ma kota”[1]")
'\t<p>Ala ma kota\xe2\x80\x9d[1]</p>'
>>> textile.textile("Ala ma kota\"[1]")
'\t<p>Ala ma kota&#8221;[1]</p>'
>>> textile.textile("Blah,[3] blah, blah")
'\t<p>Blah,[3] blah, blah</p>'

In general it looks like [no] markers must be put after letter to be handled properly. In real texts I often see them after quotes or punctuation.

Tested on textile 2.1.4 (as present in Ubuntu 10.04)

Mekk avatar Apr 18 '12 13:04 Mekk

Also this is frequent problematic case:

(OK)

>>> textile.textile("_Blah[1]_")
'\t<p><em>Blah<sup class="footnote"><a href="#fn03f467c3-37eb-489b-90cd-bcc4e5f62659">1</a></sup></em></p>'

(bad but often seen)

>>> textile.textile("_Blah_[1]")
'\t<p><em>Blah</em>[1]</p>'

Mekk avatar Apr 18 '12 14:04 Mekk