| #
bf6e4f0d
|
| 28-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
extract AbstractListsRewriter from Lists
The list-block CallWriter rewriter mixed two concerns: a shared state machine that turns flat list_open / list_item / list_close calls into the nested listu_
extract AbstractListsRewriter from Lists
The list-block CallWriter rewriter mixed two concerns: a shared state machine that turns flat list_open / list_item / list_close calls into the nested listu_open / listo_open / listitem / listcontent shape the renderers expect, and a syntax-specific marker parser that maps the captured indent + marker text to depth/type.
Hoist the state machine onto a new abstract base class AbstractListsRewriter; Lists keeps only its DokuWiki marker parser (`*` unordered, `-` ordered, 2-space-per-level indent). The upcoming GfmLists will share the same base class with its own GFM marker parser.
The interpretSyntax contract changes shape:
protected function interpretSyntax($match, &$type): int to abstract protected function interpretSyntax(string $match): array; // returns ['depth' => int, 'type' => 'u'|'o', 'start'? => int]
The optional `start` key carries the first ordered item's number for syntaxes that support it (GFM); DokuWiki omits it and gets the default of 1. Plugins subclassing Lists that override interpretSyntax need to update — known affected: creole, markdowku, mediasyntax (per codesearch.dokuwiki.org). The migration is mechanical: replace the by-ref $type assignment and int return with an associative-array return.
The protected listStart / listOpen / listEnd dispatch methods on the old Lists are gone (renamed handleListOpen / handleListItem / handleListClose on the base class), but no plugin in the ecosystem overrides those, only interpretSyntax.
show more ...
|
| #
8c5fa126
|
| 16-Apr-2026 |
Andreas Gohr <gohr@cosmocode.de> |
deduplicate finalise() across rewriter subclasses
Move the identical finalise() logic into AbstractRewriter with an abstract getClosingCall() method. Lists, Quote, Table, Preformatted and Nest each
deduplicate finalise() across rewriter subclasses
Move the identical finalise() logic into AbstractRewriter with an abstract getClosingCall() method. Lists, Quote, Table, Preformatted and Nest each provide their closing call name instead of duplicating the full method.
show more ...
|
| #
093fe67e
|
| 07-Mar-2026 |
Andreas Gohr <andi@splitbrain.org> |
updated rector and applied it
|
| #
6c16a3a9
|
| 14-Sep-2023 |
fiwswe <fiwswe@fwml.de> |
Use str_starts_with/str_ends_with
|
| #
90fb952c
|
| 31-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
code style: operator spacing
|
| #
d868eb89
|
| 30-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
codestyle adjustments: function declaration braces/spaces
|
| #
74981a4e
|
| 30-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
apply PSR-12 constant visibility rule
PSR-12 says constants need their visibility declared from PHP 7.1 onwards
|
| #
bcaec9f4
|
| 29-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
Apply rector fixes to inc/Parsing
|
| #
533aca44
|
| 02-Jun-2020 |
Andreas Gohr <andi@splitbrain.org> |
Fix accessing calls
Some plugins need access to the handler (and rewriter) calls. One example is the do plugin.
This adds some accessing methods to the callWriter objects, ensures $calls can be acc
Fix accessing calls
Some plugins need access to the handler (and rewriter) calls. One example is the do plugin.
This adds some accessing methods to the callWriter objects, ensures $calls can be accessed and removes some duplicate code by introducing an abstract base class.
show more ...
|
| #
be906b56
|
| 04-May-2018 |
Andreas Gohr <andi@splitbrain.org> |
moved all parsing related namespaces to their own
|