Commit 867cc3b
Add <panel> and <section> support for modules (#1)
* Add support for <panel> and <section> tags in Module output
- Implemented recursive parsing of PortableInfobox blocks to handle complex nesting.
- Added logic to generate Module:Tabber calls for <panel> structures.
- Standalone <section> tags are treated as groups.
- <label> children are correctly used for tab/section titles and stripped from rows.
- Ensured Template output remains unchanged and panels are ignored there.
- Fixed UI bug where conversion notes were not displayed.
- Added safety checks for MediaWiki globals in standalone environments.
- Verified all 10 edge cases including complex nesting and regressions.
Co-authored-by: whostacking <144233917+whostacking@users.noreply.github.com>
* fix: apply CodeRabbit auto-fixes
Fixed 2 file(s) based on 4 unresolved review comments.
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
* Fix <panel> and <section> rendering in Module output
- Updated recursive parser to correctly identify and extract section/tab titles from <label> or <header> tags.
- Implemented robust support for nested <panel> tags within groups or sections using Lua anonymous functions.
- Fixed regressions where utility functions were truncated and regex for self-closing tags was too greedy.
- Ensured 'Module:Tabber' requirement is added whenever a panel is present, including in nested structures.
- Improved header rendering to use section titles instead of bolded items where appropriate.
- Restored modern JS syntax for consistency and readability.
- Verified fix with complex real-world template providing expected tabbed output.
Co-authored-by: whostacking <144233917+whostacking@users.noreply.github.com>
* Implement depth-aware tag parsing and multiline Lua comment support
- Refactored `readBlocks()` to handle nested tags of the same name using a depth-aware scan.
- Updated `luaComments()` to correctly prefix each line of multiline comments with Lua comment markers.
- Added support for `<panel>` and `<section>` tags in Template output, treating them as standard sections and items.
- Improved the recursive parser to correctly identify and use child labels/headers as section titles.
- Ensured comments are preserved and correctly rendered in both Template and Module outputs.
- Fixed a bug where panel sections were not properly categorized in the internal model.
- Verified all changes with complex nested structures and real-world template examples.
Co-authored-by: whostacking <144233917+whostacking@users.noreply.github.com>
* Improve PortableInfobox parser and Lua rendering
- Fixed `readBlocks` to be depth-aware and correctly skip tags inside HTML comments.
- Refactored comment handling in `parseBlocks` to preserve original order and prevent duplicates.
- Enhanced `<panel>` parsing to collect all direct children (data, headers, groups) into default sections instead of dropping them.
- Improved Lua header rendering to resolve `source` and `<default>` values, consistent with other row types.
- Added accessibility live-region attributes to the conversion notes list.
- Fixed a bug with greedy regex in `childContent` for self-closing tags.
- Ensured consistency in modern JS syntax across `script.js`.
Co-authored-by: whostacking <144233917+whostacking@users.noreply.github.com>
* minor changes
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 122df5c commit 867cc3b
2 files changed
Lines changed: 330 additions & 124 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
0 commit comments