Fix line numbers were not shown on warnings in LaTeX and texinfo builder

This commit is contained in:
Takeshi KOMIYA
2016-01-12 10:50:02 +09:00
parent 9b45d10abd
commit 6dc7ca0234
4 changed files with 14 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ Release 1.3.5 (in development)
Bugs fixed
----------
* Fix line numbers was not shown on warnings in LaTeX and texinfo builders
Release 1.3.4 (released Jan 12, 2016)
=====================================

View File

@@ -292,9 +292,13 @@ def set_role_source_info(inliner, lineno, node):
node.source, node.line = inliner.reporter.get_source_and_line(lineno)
# monkey-patch Element.copy to copy the rawsource
# monkey-patch Element.copy to copy the rawsource and line
def _new_copy(self):
return self.__class__(self.rawsource, **self.attributes)
newnode = self.__class__(self.rawsource, **self.attributes)
if isinstance(self, nodes.Element):
newnode.source = self.source
newnode.line = self.line
return newnode
nodes.Element.copy = _new_copy

View File

@@ -24,9 +24,9 @@ from test_build_html import ENV_WARNINGS
LATEX_WARNINGS = ENV_WARNINGS + """\
None:None: WARNING: unknown option: &option
None:None: WARNING: citation not found: missing
None:None: WARNING: no matching candidate for image URI u'foo.\\*'
%(root)s/markup.txt:158: WARNING: unknown option: &option
None:60: WARNING: citation not found: missing
%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\\*'
WARNING: invalid pair index entry u''
WARNING: invalid pair index entry u'keyword; '
"""

View File

@@ -23,10 +23,10 @@ from test_build_html import ENV_WARNINGS
TEXINFO_WARNINGS = ENV_WARNINGS + """\
None:None: WARNING: unknown option: &option
None:None: WARNING: citation not found: missing
None:None: WARNING: no matching candidate for image URI u'foo.\\*'
None:None: WARNING: no matching candidate for image URI u'svgimg.\\*'
%(root)s/markup.txt:158: WARNING: unknown option: &option
None:60: WARNING: citation not found: missing
%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\\*'
%(root)s/images.txt:29: WARNING: no matching candidate for image URI u'svgimg.\\*'
"""
if PY3: