Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of table and definition list #271

Open
hauntsaninja opened this issue Jun 9, 2021 · 0 comments
Open

Incorrect parsing of table and definition list #271

hauntsaninja opened this issue Jun 9, 2021 · 0 comments

Comments

@hauntsaninja
Copy link

hauntsaninja commented Jun 9, 2021

Thanks venturing into hell to bring us mwparser! I encountered an issue with tables and definition lists, hopefully the following makes it clear:

>>> import mwparserfromhell
>>> [x.tag for x in mwparserfromhell.parse('''{|
|-
| A
| B
|-
| C
| D
|}
''').filter_tags()]
['table', 'tr', 'td', 'td', 'tr', 'td', 'td']
>>> [x.tag for x in mwparserfromhell.parse(''':{|
|-
| A
| B
|-
| C
| D
|}
''').filter_tags()]
['dd']

You can see an example of this in Wikipedia at https://en.wikipedia.org/wiki/Eulerian_number (the second table in the "Basic properties" section)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant