diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2017-12-18 14:25:07 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2017-12-18 14:25:07 +0000 |
| commit | 1a34adba564bb7254f5dfc4dbead4cdb6559d9b4 (patch) | |
| tree | a410382fc9df56b95205481dcb20c0c983394779 /docutils | |
| parent | a7b6d18960006dc3bdd9a963bb8997146446e8f9 (diff) | |
| download | docutils-1a34adba564bb7254f5dfc4dbead4cdb6559d9b4.tar.gz | |
Add tagname to "illegal element" substitution definition error message.
Be a bit more verbose when detecting nodes that are disallowed inside
substitution definitions.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@8206 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/parsers/rst/states.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docutils/parsers/rst/states.py b/docutils/parsers/rst/states.py index 4570e31dc..08f7dead4 100644 --- a/docutils/parsers/rst/states.py +++ b/docutils/parsers/rst/states.py @@ -2065,7 +2065,8 @@ class Body(RSTState): if self.disallowed_inside_substitution_definitions(node): pformat = nodes.literal_block('', node.pformat().rstrip()) msg = self.reporter.error( - 'Substitution definition contains illegal element:', + 'Substitution definition contains illegal element <%s>:' + % node.tagname, pformat, nodes.literal_block(blocktext, blocktext), source=src, line=srcline) return [msg], blank_finish @@ -2083,9 +2084,9 @@ class Body(RSTState): if (node['ids'] or isinstance(node, nodes.reference) and node.get('anonymous') or isinstance(node, nodes.footnote_reference) and node.get('auto')): - return 1 + return True else: - return 0 + return False def directive(self, match, **option_presets): """Returns a 2-tuple: list of nodes, and a "blank finish" boolean.""" |
