Wikipedia talk:Lua
Add topicAppearance
(Redirected from Wikipedia:Lua requests)
Latest comment: 1 month ago by HouseBlaster in topic Module:String, section transclusion, and Parsoid
| To help centralize discussions and keep related topics together, Help talk:Lua and all the subpages of this page (other than the archives) redirect here. |
| The content of Wikipedia:Lua/Requests was merged into Wikipedia talk:Lua on 5 February 2016. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. |
| Wikipedia:Lua/To do was nominated for deletion on 21 May 2015. The result of the discussion was keep. |
Module:String, section transclusion, and Parsoid
[edit]{{Arbitration standard provisions}} includes the text of, well, ArbCom's standard provisions. It includes the code {{#invoke:String|replace|source={{#section:Wikipedia:Arbitration Committee/Procedures|Standard appeals}}|pattern====*([^=]*)====*|replace=<p>'''%1'''</p>|plain=false}} to replace some HTML headings within Wikipedia:Arbitration Committee/Procedures § Appeals and modifications of enforcement actions with pseudoheaders; this avoid breaking arbitration cases' tables of contents.
This markup works as expected in the legacy parser, but breaks with Parsoid. Any thoughts on how to make this Parsoid-compatible? Thanks, HouseBlaster (talk • he/they) 01:15, 5 August 2026 (UTC)
- Looks like the headings come through in the legacy parser like , while in Parsoid the whole heading is hidden in the strip marker, like
=='"`UNIQ--h-5--QINU`"' Heading text == Section contentThere doesn't seem to be any way to access the heading text in the Parsoid version;'"`UNIQ--h-5--QINU`"' Section content
mw.text.unstripNoWiki()doesn't reveal it. This seems worth reporting as a behavior difference in Parsoid, maybe they'll fix it. Anomie⚔ 01:47, 5 August 2026 (UTC) - The other thing you might do is to have a module read the original wikitext of the page and extract the appropriate section directly, instead of using WP:LST and trying to process the half-parsed wikitext. But that might have its own issues. Anomie⚔ 01:47, 5 August 2026 (UTC)
- unrelated to the issue, i noticed that the pattern looks perverted.
- note that the first
=sign afterpatternis not part of the pattern, it's the speparator between param name and param value, so the actual pattern is===*([^=]*)====*(i.e., it requires 3 or more = signs before the group and 4 or more after). I guess this does not create too many problems in real life, but I think you want to fix it. קיפודנחש (aka kipod) (talk) 05:22, 5 August 2026 (UTC)
- If anyone wants to try Anomie's suggestion of parsing wikitext, there is a module for that: Module:WikitextParser. Johnuniq (talk) 06:05, 5 August 2026 (UTC)
- I created a test implementation in its sandbox at Special:Diff/1367769546. ~ Jenson (SilverLocust 💬) 22:09, 5 August 2026 (UTC)
- I've deployed that. Thank you all for your help! Best, HouseBlaster (talk • he/they) 02:13, 6 August 2026 (UTC)
- I created a test implementation in its sandbox at Special:Diff/1367769546. ~ Jenson (SilverLocust 💬) 22:09, 5 August 2026 (UTC)