| jayvdb added a comment. |
Ok, I have a small test case showing the problem occurs in the presence of new line characters.
The first is a small modification of the test suite, with a \n added to show a failure.
Then we switch the two parameters around, and it also breaks, but removing the newline then fixes it again.
>>> NESTED_TEMPLATE_REGEX.findall('{{a|1={{c|{{d|}} }}| foo = {{bar}} }} foo {{bar}} baz')
[('', '', '', '', '{{a|1={{c|{{d|}} }} | foo = {{bar}} }} foo {{bar}}')]
>>> NESTED_TEMPLATE_REGEX.findall('{{a|1={{c|{{d|}} }}\n| foo = {{bar}} }} foo {{bar}} baz')
[('', '', '', '', '{{a|1={{c|{{d|}} }}'), ('bar', '', '', '', ''), ('bar', '', '', '', '')]
>>> NESTED_TEMPLATE_REGEX.findall('{{a| foo = {{bar}}\n|1={{c|{{d|}} }} }} foo {{bar}} baz')
[('', '', '', '', '{{a| foo = {{bar}}'), ('c', '{{d|}} ', ' ', '', ''), ('bar', '', '', '', '')]
>>> NESTED_TEMPLATE_REGEX.findall('{{a| foo = {{bar}}\n|1={{c|{{d|}} }} }} foo {{bar}} baz'.replace('\n',''))
[('', '', '', '', '{{a| foo = {{bar}}|1={{c|{{d|}} }} }} foo {{bar}}')]TASK DETAIL
EMAIL PREFERENCES
To: Xqt, jayvdb
Cc: Aklapper, jayvdb, Zppix, Xqt, pywikibot-bugs-list, Mdupont
Cc: Aklapper, jayvdb, Zppix, Xqt, pywikibot-bugs-list, Mdupont
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
