| #
7595d8da
|
| 06-Jul-2026 |
splitbrain <86426+splitbrain@users.noreply.github.com> |
Rector and PHPCS fixes
|
| #
21d6f176
|
| 05-Jul-2026 |
Andreas Gohr <andi@splitbrain.org> |
fix(parser): restore BC for manual Handler/Parser construction
The parser rework made ModeRegistry a required constructor argument on Handler and Parser and dropped the Doku_Parser class alias, brea
fix(parser): restore BC for manual Handler/Parser construction
The parser rework made ModeRegistry a required constructor argument on Handler and Parser and dropped the Doku_Parser class alias, breaking the long-documented manual sub-parsing pattern used by many plugins (new Doku_Handler(); new Parser($handler); ...): both threw ArgumentCountError and new Doku_Parser() fatalled as an unknown class.
Default the ModeRegistry argument on both constructors: Handler builds a registry for the configured syntax, Parser takes it from the handler. Re-add the Doku_Parser alias. Constructing without a registry emits a deprecation pointing at p_get_instructions().
show more ...
|
| #
47a02a10
|
| 04-Jun-2026 |
Andreas Gohr <gohr@cosmocode.de> |
Parsing: make parse syntax a per-parse value, drop ModeInterface
The active parse's syntax flavour is a per-parse question, not process- global state: within a single request a plugin can render bun
Parsing: make parse syntax a per-parse value, drop ModeInterface
The active parse's syntax flavour is a per-parse question, not process- global state: within a single request a plugin can render bundled DokuWiki-syntax text inside an otherwise-Markdown page. Yet ModeRegistry was a singleton that read $conf['syntax'] and the $PARSER_MODES global, and every mode reached it through ModeRegistry::getInstance() — so the flavour lived in shared mutable state that two parses in one request would fight over.
Make the registry a short-lived value instead:
- ModeRegistry is constructed once per parse with an explicit $syntax and injected into Parser, Handler and every mode. getSyntax() / isDwPreferred() / isMdPreferred() consult $this->syntax; the DOKU_UNITTEST-gated mode-list cache hack is gone (each registry is fresh, nothing to invalidate). - p_get_instructions() is now the single place in the pipeline where $conf['syntax'] is read; from there the flavour travels as a parameter. No code under inc/Parsing/ reads $conf['syntax'] directly anymore — the five syntax-reading modes (Preformatted, GfmHr, GfmEscape, Externallink, GfmQuote) route through $this->registry.
Keep the two concepts apart, as documented in the ModeRegistry and AbstractMode docblocks: the user's configured *preference* stays in $conf['syntax'] for UI code (toolbar, settings), while the active parse's syntax is a parameter carried by the registry.
$PARSER_MODES is demoted to a deprecated, read-only mirror, published during loadPluginModes() — third-party syntax plugins (columnlist, alphalist2, phpwikify, skipentity) and the bundled info plugin read the global directly, often from their constructors, so the taxonomy must stay visible there. No core code reads the mirror.
Fold ModeInterface into AbstractMode while here: getSort()/handle() are abstract, the connect callbacks carry defaults, and the public $Lexer "FIXME should be done by setter" becomes setLexer()/getLexer() injected by Parser::addMode() alongside the registry. Nested-content resolution moves to the allowedCategories()/filterAllowedModes() hooks, resolved once when the registry is attached.
Tests build their own parser/registry through ParserTestBase::setSyntax() instead of mutating $conf and calling the removed ModeRegistry::reset().
show more ...
|
| #
cb0a6471
|
| 12-May-2026 |
Andreas Gohr <andi@splitbrain.org> |
Merge branch 'master' into gfm
* master: Fix syntax plugin rendering
|
| #
7686f203
|
| 12-May-2026 |
Anna Dabrowska <dabrowska@cosmocode.de> |
Fix syntax plugin rendering
Reverse the order in which core modes and plugin modes are handled by the \dokuwiki\Parsing\Handler. Otherwise only the handle() method of the plugin is called, which is
Fix syntax plugin rendering
Reverse the order in which core modes and plugin modes are handled by the \dokuwiki\Parsing\Handler. Otherwise only the handle() method of the plugin is called, which is fine for core modes. Syntax plugins need to go through plugin() to actually add their own calls.
show more ...
|
| #
06ab3bb2
|
| 12-May-2026 |
Andreas Gohr <andi@splitbrain.org> |
Merge branch 'master' into gfm
* master: (176 commits) Delete inc/Search/concept.txt Rector and PHPCS fixes Update deleted files updated phpseclib dependency use new ModeRegistry con
Merge branch 'master' into gfm
* master: (176 commits) Delete inc/Search/concept.txt Rector and PHPCS fixes Update deleted files updated phpseclib dependency use new ModeRegistry constant in info plugin keep historic typo in value but not in constant SearchIndex: fix comment position Rector and PHPCS fixes Translation update (tr) Translation update (fr) refactor(changelog): persist external-edit detection on first read fix(infoutils): escape git log arguments for Windows compatibility fix(preview): remove deprecated X-XSS-Protection header fix: don't move the editor textarea into the toolbar fix EXIF-rotated images shown cropped in previews, closes #4482 fix: avoid picker close/reopen race on toggle button click subscriptions: include diff link in plain-text list mails too Translation update (ru) Translation update (pl) Translation update (pt-br) ...
# Conflicts: # inc/Parsing/ParserMode/Quote.php
show more ...
|
| #
8788dbbd
|
| 06-May-2026 |
splitbrain <86426+splitbrain@users.noreply.github.com> |
Rector and PHPCS fixes
|
| #
309a0852
|
| 30-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
replace DW Quote with unified GfmQuote
GfmQuote covers blockquote parsing for both DokuWiki and GFM dialects in a single mode. Same quote_open/quote_close handler instructions; a DW-preferred post-p
replace DW Quote with unified GfmQuote
GfmQuote covers blockquote parsing for both DokuWiki and GFM dialects in a single mode. Same quote_open/quote_close handler instructions; a DW-preferred post-pass flattens sub-parsed paragraph wrapping into linebreak calls so existing pages keep their <br/>-between-lines rendering. MD-preferred keeps the <p>-wrapped spec shape.
Block content (lists, fenced code, tables) inside `>` quotes now renders, since the body is sub-parsed. Headers stay excluded (BASEONLY) — TOC and section-edit anchors don't compose with <blockquote>, same rationale as GfmListblock.
Convert ModeRegistry's sub-parser cache into an acquire/release pool to support same-key re-entrancy: a list inside a quote re-enters gfm_quote during the list-item sub-parse, and the inner call needs its own parser instance even though the exclusion key matches. GfmListblock is updated to use the new acquire/release primitives.
show more ...
|
| #
9172eccf
|
| 28-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
add sub-parser support to Handler / Parser / ModeRegistry
A block mode that wants to parse the body of one of its captured matches needs a second Parser instance configured with the active modes min
add sub-parser support to Handler / Parser / ModeRegistry
A block mode that wants to parse the body of one of its captured matches needs a second Parser instance configured with the active modes minus whatever would re-enter the outer mode. Doing this by hand is verbose and easy to get wrong — modes hold a $Lexer slot that addMode() overwrites, so the same mode object can't be shared between the main parser and a sub-parser.
Three small additions:
Handler::reset() — clears calls, status, currentModeName, and installs a fresh CallWriter. Lets one Handler instance be parsed against repeatedly without state bleed.
Parser::getHandler() — accessor; sub-parser callers need it to reach the handler for reset() and for harvesting the produced call list.
ModeRegistry::getSubParser($excludeCategories, $excludeModes) — returns a cached Parser preconfigured with every active mode except those excluded. Mode objects are cloned before being attached so connectTo()'s assignment to $Lexer does not clobber the main parser's references. Cache key is the exclusion-set; default exclusion is CATEGORY_BASEONLY (no Header inside the sub-parsed content).
Tests cover Handler::reset's full clear, sub-parser caching, default and custom exclusions, registry-reset propagation, and the clone-not-share invariant for $Lexer.
show more ...
|
| #
04045fea
|
| 18-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
remove unused rewriteBlocks property from Handler
This flag was added in b7c441b9 (2005) for planned wiki syntax converters but was never set to false anywhere. Remove the dead conditional and alway
remove unused rewriteBlocks property from Handler
This flag was added in b7c441b9 (2005) for planned wiki syntax converters but was never set to false anywhere. Remove the dead conditional and always run Block processing.
show more ...
|
| #
3ea3771b
|
| 18-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
supress code sniffer warning on deprecation wrapper
Previously the whole file was excluded. We can now be more precise.
|
| #
71096e46
|
| 18-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
move handler methods into ParserMode classes and rename Handler
Each ParserMode class now implements handle() from ModeInterface, containing the token handling logic that previously lived as individ
move handler methods into ParserMode classes and rename Handler
Each ParserMode class now implements handle() from ModeInterface, containing the token handling logic that previously lived as individual methods on Doku_Handler.
The Handler class (formerly Doku_Handler) is the single dispatch point: Lexer passes tokens to Handler::handleToken() which routes to mode objects, plugins, or returns false. The Lexer only tokenizes and resolves mapHandler aliases.
Key changes: - Add handle() to ModeInterface, implemented by all mode classes - Move Doku_Handler to dokuwiki\Parsing\Handler namespace - File extends Code (shared parsing via $type property) - Quotes uses mapHandler() + Handler::getModeName() for sub-modes - Media::parseMedia() replaces Doku_Handler_Parse_Media() - Code::parseHighlightOptions() replaces parse_highlight_options() - Per-parse state (footnote, doublequote) stays on Handler - Deprecated wrappers kept for base/header/internallink/media - Class alias and rector rules added for backward compatibility
show more ...
|