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 result with lists in template parameters #7

Open
WesWrench opened this issue May 16, 2023 · 3 comments
Open

Incorrect result with lists in template parameters #7

WesWrench opened this issue May 16, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@WesWrench
Copy link

WesWrench commented May 16, 2023

Hello,

i have test your composer on this code : https://en.wikipedia.org/w/index.php?title=Template:Routing_software&action=edit
and the result is :

<ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li>{{Navbox
|name=Routing software
|title=[[List of router firmware projects|Routing software]]
|listclass=hlist
|state={{{state|autocollapse}}}

|group1=[[Operating system|operating<br>systems]]<br>&<br>[[Network operating system|network<br>operating<br>systems]]
|list1={{Navbox|child
 |group1=[[Linux kernel|Linux]]-<br>based
 |list1={{Navbox|child
  |group1=[[Free and open-source software|entirely free]]
  |list1=
*[[Endian Firewall|Endian]]
*[[Floppyfw]]
*[[IPFire]]
*[[LEDE]]
*[[libreCMC]]
*[[OpenWrt]]
*[[VyOS]]
*[[Zeroshell]]
  |group2=[[Proprietary software|partly proprietary]]
  |list2=
*[[Ubiquiti Networks|AirOS & EdgeOS]]
*[[AlliedWare Plus|Alliedware Plus]]
*[[DD-WRT]]
*[[ExtremeXOS]]
*[[Fritz!Box|FRITZ!Box]]
*[[MikroTik#RouterOS|RouterOS]]
*[[SmoothWall]]
*[[Tomato (firmware)|Tomato]]
*[[Vyatta]]
}}
 |group2=[[FreeBSD]]-<br>based
 |list2={{Navbox|child
  |group1=[[Free and open-source software|entirely free]]
  |list1=
*[[m0n0wall]]
*[[OPNsense]]
*[[pfSense]]
  |group2=[[Proprietary software|partly proprietary]]
  |list2=
*[[Junos OS]]
}}
|group3=[[Proprietary software|proprietary]]
|list3=
*[[Cisco IOS]]
*[[Extreme Networks|ExtremeWare]]
*[[Cisco NX-OS|NX-OS]]
*[[Alcatel-Lucent|TiMOS]]
*[[Huawei|VRP]]
}}

|group2=routing daemons
|list2=
*[[Babel (protocol)|Babel]]
*[[B.A.T.M.A.N.]]
*[[Bird Internet routing daemon|BIRD]]
*[[FRRouting]]
*[[GNU Zebra]]
*[[OpenBGPD]]
*[[OpenOSPFD]]
*[[Quagga (software)|Quagga]]
*[[XORP]]

|group3=other software
|list3=
*[[Captive portal]]
*[[Neighbornode]]
*[[Tor (network)|Tor]]

|group4=related articles
|list4=
*[[Comparison of firewalls]]
*[[List of router and firewall distributions]]
*[[List of router firmware projects]]
*[[National Security Agency#Software backdoors]]
}}
{{Documentation}}
</li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul>
@clokep
Copy link
Owner

clokep commented May 16, 2023

It does tend to break a bit with nested lists, but without knowing more information about how you ran it or what you're attempting to do I'm not sure I can help much.

@WesWrench
Copy link
Author

WesWrench commented May 17, 2023

Hello, i put the wikicode in a txt file and i run this :

import mwparserfromhell
import mwcomposerfromhell
import json

f = open("firewall.txt", "r")
firewall_mw = f.read()

wikicode = mwparserfromhell.parse(firewall_mw)

html = mwcomposerfromhell.compose(wikicode)


f = open("firewall.html", "w+")
firewall_mw = f.write(html)

@clokep
Copy link
Owner

clokep commented May 17, 2023

A reduced test-case:

{{Navbox
|list1=
*[[Article]]
}}

Which results in:

<ul><li>{{Navbox
|list1=
*[[Article]]
}}</li></ul>

It probably should generate:

{{Navbox
|list1=
<ul><li><a href="/wiki/Article" title="Article">Article</a>
</li></ul>
}}

@clokep clokep changed the title Not Work For Navbox Incorrect result with lists in template parameters May 17, 2023
@clokep clokep added the bug Something isn't working label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants