Module talk:WikitextParser
Appearance
This module should use Module:Plain text for parsing section names
[edit]Currently it just reads them naively. This causes an issue in Module:Excerpt which uses this to find section names. If the section has an anchor then it will not correctly find it. — Qwerfjkltalk 16:29, 14 May 2026 (UTC)
- I think it's a good idea, but not as easy to implement as one might expect. Firstly, the plainText logic should probably be enhanced to strip files, categories, etc in languages other than English (though that's not too critical). Also, since the code is quite short and straightforward, I'll probably prefer to copy it rather than loading it, to avoid dependency complications. It can also be customized to better fit the needs of this particular use case. But more importantly, due to the way getSection currently works, it'll need to be completely rewritten to add plainText to it. It's not that straightforward. I started to do it in the sandbox, but with these changes, it no longer transcludes subsections, and apparently quite a few pages depend on that feature already. But I like the new sandbox version of getSection, so I'm thinking on writing a new getSubsections method that combined with getSection could re-implement the "subsections" feature. Furthermore, perhaps this set of changes is a good opportunity to implement this other good idea to increase/decrease the level of the subsections when needed. So anyway, it may take a bit of time to implement, but I think it's a good idea. Thanks for proposing it. Sophivorus (talk) 15:06, 15 May 2026 (UTC)