mwparserfromhell
mwparserfromhell copied to clipboard
Adding table cell attribute does not add pipe
import mwparserfromhell
code = mwparserfromhell.parse('{|\n|foo\n|}')
code.filter_tags(matches=lambda t: t.tag == 'td')[0].attributes.append('bar')
print(code)
output:
{|
|barfoo
|}
expected output:
{|
|bar|foo
|}
A proper fix for this will involve reworking how wikicode-style tags are represented in the tree structure. I don't think it will be especially difficult, but it will be a breaking change.