File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -135,10 +135,9 @@ def compare_references(
135135 warning_msg : str ,
136136 ) -> None :
137137 """Warn about mismatches between references in original and translated content."""
138- # FIXME: could use a smarter strategy than len(old_refs) == len(new_refs)
139- if not self .noqa and len (old_refs ) != len (new_refs ):
140- old_ref_rawsources = [ref .rawsource for ref in old_refs ]
141- new_ref_rawsources = [ref .rawsource for ref in new_refs ]
138+ old_ref_rawsources = [ref .rawsource for ref in old_refs ]
139+ new_ref_rawsources = [ref .rawsource for ref in new_refs ]
140+ if not self .noqa and old_ref_rawsources != new_ref_rawsources :
142141 logger .warning (
143142 warning_msg .format (old_ref_rawsources , new_ref_rawsources ),
144143 location = self .node ,
Original file line number Diff line number Diff line change @@ -192,6 +192,12 @@ def test_text_inconsistency_warnings(app):
192192 'translated' : '\\ [\\ ]' ,
193193 }
194194 + warning_fmt
195+ % {
196+ 'reftype' : 'citation references' ,
197+ 'original' : "\\ ['\\ [ref2\\ ]_'\\ ]" ,
198+ 'translated' : "\\ ['\\ [ref3\\ ]_'\\ ]" ,
199+ }
200+ + warning_fmt
195201 % {
196202 'reftype' : 'references' ,
197203 'original' : "\\ ['reference_'\\ ]" ,
You can’t perform that action at this time.
0 commit comments