diff --git a/pospell.py b/pospell.py index d7945d0..9c49920 100644 --- a/pospell.py +++ b/pospell.py @@ -90,11 +90,14 @@ class NodeToTextVisitor(docutils.nodes.NodeVisitor): "emphasis", "superscript", "title_reference", + "substitution_reference", + "citation_reference", "strong", "DummyNodeClass", "reference", "literal", "Text", + "system_message", ) def __init__(self, document): @@ -123,7 +126,7 @@ class NodeToTextVisitor(docutils.nodes.NodeVisitor): def visit_Text(self, node): """Keep this node text, this is typically what we want to spell check.""" - self.output.append(node.rawsource) + self.output.append(docutils.nodes.unescape(node, restore_backslashes=True)) def __str__(self): """Give the accumulated strings.""" diff --git a/setup.cfg b/setup.cfg index ecbe838..a5b7292 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,7 @@ classifiers = [options] py_modules = pospell python_requires = >= 3.6 -install_requires = polib; docutils>=0.11,<0.18; regex +install_requires = polib; docutils>=0.16; regex [options.entry_points] console_scripts = pospell=pospell:main