mwparserfromhell icon indicating copy to clipboard operation
mwparserfromhell copied to clipboard

Adding table cell attribute does not add pipe

Open Larivact opened this issue 5 years ago • 1 comments

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
|}

Larivact avatar Mar 07 '19 09:03 Larivact

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.

earwig avatar Mar 13 '19 03:03 earwig