| #
7958e698 |
| 16-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
decouple hardcoded mode names in Eol and Preformatted
Eol.php hardcoded ['listblock', 'table'] as modes to skip, and Preformatted.php hardcoded [\*\-] as a negative lookahead for list markers. Both
decouple hardcoded mode names in Eol and Preformatted
Eol.php hardcoded ['listblock', 'table'] as modes to skip, and Preformatted.php hardcoded [\*\-] as a negative lookahead for list markers. Both embed knowledge that belongs to the respective block modes, not to Eol/Preformatted. Adding a new block mode that handles its own EOL or uses different line start markers would require editing these unrelated files — a hidden coupling.
Listblock and Table now register themselves on ModeRegistry during preConnect(). Eol queries getBlockEolModes() and Preformatted queries getLineStartMarkers() to build its lookahead dynamically. Each mode owns its own data, and new block modes can participate without touching unrelated files.
show more ...
|
| #
1f443476 |
| 16-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
split Formatting into individual classes per formatting type
Introduce AbstractFormatting as a base class and seven concrete classes (Strong, Emphasis, Underline, Monospace, Subscript, Superscript,
split Formatting into individual classes per formatting type
Introduce AbstractFormatting as a base class and seven concrete classes (Strong, Emphasis, Underline, Monospace, Subscript, Superscript, Deleted) that each define their own patterns and sort order. Delete the old Formatting class and update tests to use the new classes directly. ModeRegistry now treats formatting modes as regular built-in modes.
show more ...
|
| #
c8dd1b9d |
| 16-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
introduce ModeRegistry to encapsulate parser mode categories
Replace the global $PARSER_MODES definition in inc/parser/parser.php with a ModeRegistry singleton that initializes and manages the mode
introduce ModeRegistry to encapsulate parser mode categories
Replace the global $PARSER_MODES definition in inc/parser/parser.php with a ModeRegistry singleton that initializes and manages the mode categories. The global array is still populated for backward compatibility with plugins that access it directly.
Mode constructors now use ModeRegistry::getModesForCategories() instead of accessing the global directly. p_get_parsermodes() and p_sort_modes() are moved to inc/deprecated.php as thin wrappers.
show more ...
|