<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in GfmEmphasisTest.php</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2025</copyright>
    <generator>Java</generator><item>
        <title>1c00c02121477c81b95fe750b94acdf109cba20a - fix(parser): validate inline formatting closers with a single memoized scan</title>
        <link>http://127.0.0.1:8080/history/dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php#1c00c02121477c81b95fe750b94acdf109cba20a</link>
        <description>fix(parser): validate inline formatting closers with a single memoized scanThe inline formatting modes only open a span when a valid closer existsahead. That check was a lookahead built on CONTENT_UNTIL_PARA, testedcharacter by character up to the next paragraph break and re-evaluatedfrom scratch for every opener candidate &#8212; openers times paragraphlength. With pcre.jit=0 a crafted 32KB page took 16s and an ordinary34KB page with long paragraphs 37s; with the JIT on (the PHP default)the per-character lookahead exhausted the JIT stack, the match silentlyfailed, and the formatting &#8212; or everything after it &#8212; rendered as plaintext.The check also decided the wrong thing. It scanned raw text, so a closerlookalike inside content the lexer consumes atomically &#8212; a nowiki or %%span, a backtick code span, a link, a URL &#8212; counted as a real closereven though the mode&apos;s exit pattern can never fire there. And it ignoredthe enclosing span: an inner delimiter whose only closer lay past thecloser of the mode it sits in was entered anyway, so a stray delimiterpaired with one in a following sibling span and dragged the boundaryalong &#8212; the `*` in &apos;&apos;glob/*.conf&apos;&apos; joined the `*` of the next &apos;&apos;...&apos;&apos;span and corrupted the paragraph; the same held for //, ** and __ insidemonospace, and an emphasis opened inside ((...)) ran past the footnote&apos;s)) and the enclosing bold&apos;s **.Each formatting mode now declares its closer throughLexer::addCloserPattern(), mirroring addExitPattern(), and the lexeranswers &quot;does a valid closer exist ahead&quot; with one anchored possessivescan per range instead of a lookahead per opener:- The scan runs left to right from the opener, hopping over opaque spans  derived from already-registered patterns &#8212; a plain or special match is  consumed in one step, an entry into a verbatim mode (nowiki, the  backtick code spans) extends to that mode&apos;s first exit &#8212; so a closer  lookalike inside consumed content is never mistaken for a closer. Each  hop finds the earliest of boundary, closer, or opaque span in a single  leftmost search, keeping the check linear.- An opener is rejected when the nearest enclosing mode that has a closer  of its own would close before the opener&apos;s own closer, so a delimiter  that can never close within its span stays literal. That ancestor is  found by walking the mode stack past modes that declare no closer  (plugins, footnotes); the nearest guarded ancestor suffices, as it was  itself validated against its own when it opened.- Both verdicts are memoized and reset per parse() run: a proven closer  validates every earlier candidate, and a proven closer-free range  rejects every later candidate before the next boundary. With the lexer  consuming each opened span, the whole parse is linear in document size.Closer patterns match the closing delimiter itself with flanking contextin lookarounds &#8212; the convention exit patterns already follow &#8212; so closerpositions compare exactly across modes and a closer directly after aninner opener is seen. AbstractFormatting derives the closer from the exitpattern and registers it with the paragraph break as the boundary,preserving the rule that formatting never spans paragraphs; a mode withother needs can pass a different boundary or none.Footnote declares its )) as a closer rather than guarding its (( entrywith a (?=.*)) lookahead, so the footnote becomes a boundary the scansees and formatting inside it no longer pairs across the )); its closertakes no paragraph boundary, as footnotes are block-level. GfmEmphasisgains a closer pattern so single * emphasis is validated the same way,while its entry lookahead still enforces CommonMark nearest-delimiterpairing. GfmEmphasis and GfmStrong span bodies cannot contain theirdelimiter, so their in-pattern lookaheads stay linear on their own; theGFM backtick span bodies get deterministic alternatives with possessivequantifiers, removing their per-character backtracking.CONTENT_UNTIL_PARA is removed: any entry pattern built with it recreatesthe quadratic scan. ParallelRegex gains escapePattern() so embeddedcloser fragments follow the lexer&apos;s bare-parenthesis convention, reportsPREG_JIT_STACKLIMIT_ERROR so a future JIT exhaustion surfaces instead ofsilently truncating, and no longer rewrites its registered patterns inplace while compiling the compound regex.The adversarial 32KB page drops to 0.1s, the 37-second benign page to0.1s, and a 128KB variant stays under 0.6s.

            List of files:
            /dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php</description>
        <pubDate>Thu, 09 Jul 2026 12:09:52 +0000</pubDate>
        <dc:creator>Andreas Gohr &lt;gohr@cosmocode.de&gt;</dc:creator>
    </item>
<item>
        <title>47a02a102092be9e1e6f1ddaf158bdfffdb13d4f - Parsing: make parse syntax a per-parse value, drop ModeInterface</title>
        <link>http://127.0.0.1:8080/history/dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php#47a02a102092be9e1e6f1ddaf158bdfffdb13d4f</link>
        <description>Parsing: make parse syntax a per-parse value, drop ModeInterfaceThe active parse&apos;s syntax flavour is a per-parse question, not process-global state: within a single request a plugin can render bundledDokuWiki-syntax text inside an otherwise-Markdown page. Yet ModeRegistrywas a singleton that read $conf[&apos;syntax&apos;] and the $PARSER_MODES global,and every mode reached it through ModeRegistry::getInstance() &#8212; so theflavour lived in shared mutable state that two parses in one requestwould 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-&gt;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[&apos;syntax&apos;] is read; from there the flavour travels as a  parameter. No code under inc/Parsing/ reads $conf[&apos;syntax&apos;] directly  anymore &#8212; the five syntax-reading modes (Preformatted, GfmHr,  GfmEscape, Externallink, GfmQuote) route through $this-&gt;registry.Keep the two concepts apart, as documented in the ModeRegistry andAbstractMode docblocks: the user&apos;s configured *preference* stays in$conf[&apos;syntax&apos;] for UI code (toolbar, settings), while the activeparse&apos;s syntax is a parameter carried by the registry.$PARSER_MODES is demoted to a deprecated, read-only mirror, publishedduring loadPluginModes() &#8212; third-party syntax plugins (columnlist,alphalist2, phpwikify, skipentity) and the bundled info plugin read theglobal directly, often from their constructors, so the taxonomy muststay visible there. No core code reads the mirror.Fold ModeInterface into AbstractMode while here: getSort()/handle() areabstract, the connect callbacks carry defaults, and the public $Lexer&quot;FIXME should be done by setter&quot; becomes setLexer()/getLexer() injectedby Parser::addMode() alongside the registry. Nested-content resolutionmoves to the allowedCategories()/filterAllowedModes() hooks, resolvedonce when the registry is attached.Tests build their own parser/registry through ParserTestBase::setSyntax()instead of mutating $conf and calling the removed ModeRegistry::reset().

            List of files:
            /dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php</description>
        <pubDate>Thu, 04 Jun 2026 12:27:59 +0000</pubDate>
        <dc:creator>Andreas Gohr &lt;gohr@cosmocode.de&gt;</dc:creator>
    </item>
<item>
        <title>13a62f810fbd091d15ab734b467eaec0a6bf829a - rename syntax flavors &apos;dokuwiki&apos; / &apos;markdown&apos; to &apos;dw&apos; / &apos;md&apos;</title>
        <link>http://127.0.0.1:8080/history/dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php#13a62f810fbd091d15ab734b467eaec0a6bf829a</link>
        <description>rename syntax flavors &apos;dokuwiki&apos; / &apos;markdown&apos; to &apos;dw&apos; / &apos;md&apos;Symmetry with the existing &apos;dw+md&apos; / &apos;md+dw&apos; setting values.

            List of files:
            /dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php</description>
        <pubDate>Mon, 04 May 2026 10:18:11 +0000</pubDate>
        <dc:creator>Andreas Gohr &lt;andi@splitbrain.org&gt;</dc:creator>
    </item>
<item>
        <title>685560eb3044321b3bdd0be40985871ced5f1d05 - add GfmListblock for GFM lists</title>
        <link>http://127.0.0.1:8080/history/dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php#685560eb3044321b3bdd0be40985871ced5f1d05</link>
        <description>add GfmListblock for GFM listsGfmListblock captures an entire list block atomically with oneaddSpecialPattern match, then walks the captured text in handle()grouping lines into items. Each item&apos;s body is dedented to itscontent column and parsed by ModeRegistry::getSubParser() soblock content (paragraphs, fenced code, blockquotes, pluginblocks) works inside items uniformly. Sub-parsed calls are wrappedin a Nest call before they reach the outer handler, matching theFootnote pattern: the main handler&apos;s Block rewriter treats nestas opaque and the renderer base class unwraps it transparently,so multi-paragraph items don&apos;t get double-wrapped in &lt;p&gt;.Marker syntax: -, *, + (unordered) or 1-9 digits followed by. or ) (ordered). Indentation is a 2-space-multiple step startingat 0; depth = (indent / 2) + 1, odd indents round down, tabs becometwo spaces. The first ordered item&apos;s number drives the startattribute on &lt;ol&gt; via the listo_open $start parameter.GfmLists subclasses AbstractListsRewriter with the GFM markerparser; the state machine on the base class is shared with DW Lists.GfmListblock loads only when $conf[&apos;syntax&apos;] is markdown or md+dw.Under those settings the DW Listblock is suppressed because the twolist models conflict &#8212; DW&apos;s mandatory 2-space indent rule vs GFM&apos;szero-indent top-level rule, and -/*/+ markers shared. Plugins thatrelied on Listblock loading under md+dw will see it absent there.Sub-parser exclusion set: CATEGORY_BASEONLY (no Header inside listitems) and gfm_listblock itself (defensive guard against re-entryon pathological inputs; nested lists are handled by the outerpattern, not by re-entry).Tests cover marker variants, ordered start numbers, nested lists attwo and three levels, inline formatting inside items, marker-character switches keeping one list, type switches splitting thelist, fenced code inside items, multi-paragraph (loose) items, andtwo regressions on blank-line tolerance inside the captured block.SpecCompatRenderer learns to render the list call sequence, andspec.txt tests for digit/marker-width/lazy-continuation behaviorthat GfmListblock deliberately doesn&apos;t implement are documented ingfm-spec/skip.php with the per-bucket reasons (A-F).Drops two now-obsolete entries from skip.php (image escapes thatland via earlier GfmLink/GfmMedia work) and inlines the Setextexplanation that previously pointed at SPEC.md. Replaces theSPEC.md reference in GfmEmphasisTest with the inline reason.

            List of files:
            /dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php</description>
        <pubDate>Tue, 28 Apr 2026 06:23:11 +0000</pubDate>
        <dc:creator>Andreas Gohr &lt;andi@splitbrain.org&gt;</dc:creator>
    </item>
<item>
        <title>0244be5c08829b6ca187d7158bca94e7c2fd7be3 - add GfmDeleted mode for GFM strikethrough (`~~text~~`)</title>
        <link>http://127.0.0.1:8080/history/dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php#0244be5c08829b6ca187d7158bca94e7c2fd7be3</link>
        <description>add GfmDeleted mode for GFM strikethrough (`~~text~~`)Shares the deleted_open/deleted_close instructions with DW&apos;s &lt;del&gt; mode.Entry/exit anchors `(?&lt;!~)` / `(?!~)` reject runs of three or more tildesso fenced-code markers remain untouched. Also trim redundant class-leveldocblocks on sibling Gfm test files.

            List of files:
            /dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php</description>
        <pubDate>Tue, 21 Apr 2026 13:52:10 +0000</pubDate>
        <dc:creator>Andreas Gohr &lt;gohr@cosmocode.de&gt;</dc:creator>
    </item>
<item>
        <title>bcefb8ae61f4ff776efdbad9508c8ee8e5c548a6 - add GFM emphasis and underscore-delimited strong modes</title>
        <link>http://127.0.0.1:8080/history/dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php#bcefb8ae61f4ff776efdbad9508c8ee8e5c548a6</link>
        <description>add GFM emphasis and underscore-delimited strong modesThree new inline formatting modes for GitHub Flavored Markdown:  GfmEmphasis            `*text*`    &#8594; &lt;em&gt;  GfmEmphasisUnderscore  `_text_`    &#8594; &lt;em&gt;    (MD-preferred only)  GfmStrongUnderscore    `__text__`  &#8594; &lt;strong&gt; (MD-preferred only)All three emit the same handler instructions as DokuWiki&apos;s Emphasis /Strong, so existing renderers need no changes.Design notes:* Lexer mode names use snake_case (gfm_emphasis, gfm_emphasis_underscore,  gfm_strong_underscore) to keep PascalCase readable at the class level.  The asterisk variant emits `emphasis_open`/`emphasis_close` via the  getInstructionName() hook, so DW&apos;s Emphasis (`//...//`) and  GfmEmphasis (`*...*`) can coexist in mixed modes without a lexer  state collision while still producing the same &lt;em&gt; output.* Underscore variants gate on Markdown-preferred syntax (`markdown`,  `md+dw`) because `__` otherwise means DW underline. GfmStrongUnderscore  sorts at 70 (matching Strong) &#8212; below Underline at 90 &#8212; so when loaded  it wins the lexer race for `__` runs. Underline is already gated out  of MD-preferred modes in the previous commit.* Entry patterns enforce the simplified CommonMark flanking rules  already shared across DW inline modes (non-whitespace adjacency,  no paragraph-boundary crossing) plus the word-boundary check for  underscore variants using NO_WORD_BEFORE / NO_WORD_AFTER. The  positive non-word-char enumeration makes them multibyte-safe without  requiring the `u` flag: `f&#252;r_etwas` and `&#1087;&#1088;&#1080;&#1089;&#1090;&#1072;&#1085;&#1103;&#1084;_&#1089;&#1090;&#1088;&#1077;&#1084;&#1103;&#1090;&#1089;&#1103;_`  correctly stay literal.Per-mode unit tests cover basic matching, single-char bodies,leading/trailing-whitespace rejection, empty-delimiter rejection,paragraph-boundary rejection, multibyte intraword protection, andsort values. ModeRegistryTest&apos;s gating data provider picks up thethree new rules.

            List of files:
            /dokuwiki/_test/tests/Parsing/ParserMode/GfmEmphasisTest.php</description>
        <pubDate>Mon, 20 Apr 2026 18:52:28 +0000</pubDate>
        <dc:creator>Andreas Gohr &lt;gohr@cosmocode.de&gt;</dc:creator>
    </item>
</channel>
</rss>
