Home
last modified time | relevance | path

Searched hist:"0 f694376a45b6a9e3a163cf19dccda0c2dc008f0" (Results 1 – 2 of 2) sorted by relevance

/dokuwiki/inc/Parsing/ParserMode/
H A DGfmLink.php0f694376a45b6a9e3a163cf19dccda0c2dc008f0 Tue May 05 20:04:32 UTC 2026 Andreas Gohr <gohr@cosmocode.de> GfmLink: accept escaped brackets inside link labels

The label slot used `[^\[\]\n]+`, which rejected `\[` / `\]` and
left labels with escaped brackets unmatched. Promote it to
`(?:\\.|[^\[\]\n])+` — the same backslash-escape trick the URL
slot already uses — so spec example 523 (`[link \[bar](/uri)`)
matches and unescapes cleanly. The image-as-label sub-pattern
gets the same upgrade.

handle() needs no change: the new class still rejects bare `]`,
so the first literal `](` in the match is still the separator;
Escape::unescapeBackslashes() was already collapsing `\[` to `[`
before the label reached the link handler.

Adds two GfmLinkTest cases for the `\[` / `\]` forms.

/dokuwiki/_test/tests/Parsing/ParserMode/
H A DGfmLinkTest.php0f694376a45b6a9e3a163cf19dccda0c2dc008f0 Tue May 05 20:04:32 UTC 2026 Andreas Gohr <gohr@cosmocode.de> GfmLink: accept escaped brackets inside link labels

The label slot used `[^\[\]\n]+`, which rejected `\[` / `\]` and
left labels with escaped brackets unmatched. Promote it to
`(?:\\.|[^\[\]\n])+` — the same backslash-escape trick the URL
slot already uses — so spec example 523 (`[link \[bar](/uri)`)
matches and unescapes cleanly. The image-as-label sub-pattern
gets the same upgrade.

handle() needs no change: the new class still rejects bare `]`,
so the first literal `](` in the match is still the separator;
Escape::unescapeBackslashes() was already collapsing `\[` to `[`
before the label reached the link handler.

Adds two GfmLinkTest cases for the `\[` / `\]` forms.