Closed jfbu closed 2 years ago
Did you find any workaround ?
Does escaping the apostrophe like l\'eau
help?
The Docutils recommonmark wrapper merges adjoining Text nodes:
for node in document.traverse(nodes.TextElement):
children = node.children
i = 0
while i+1 < len(children):
if (isinstance(children[i], nodes.Text)
and isinstance(children[i+1], nodes.Text)):
children[i] = nodes.Text(children[i]+children.pop(i+1))
children[i].parent = node
else:
i += 1
Maybe this would solve the issue.
Otherwise, disable SmartQuotes. Typographical quotes in the source are passed unchanged.
Consider this source
eau1.md
Inserting this in a Sphinx project with
language='fr'
and inconf.py
and executing for example
make pseudoxml
one obtainswhereas a similar
.rst
document is transformed intoIn the former case
l'eau
gives three text elements and the Docutils smart quotes transforme acted erroneously, not recognizing a case of elision. In the latter case there is only on text element, and Docutils smart quotes acted correctly.Notice that smart quotes is default for Sphinx html builder.
For a better description see this comment to Sphinx issue #6282. I am thus raising the issue here :)