Skip to content

[BUGFIX] Escape slashes in marker replacement - #5

Merged
chriwo merged 2 commits into
feature/updateV13from
bugfix/unqoted-slash-in-marker-regex
Sep 22, 2026
Merged

chriwo merged 2 commits into
feature/updateV13from
bugfix/unqoted-slash-in-marker-regex

Conversation

@chriwo

@chriwo chriwo commented Sep 22, 2026

Copy link
Copy Markdown

Markers whose key contains a slash were never replaced in the frontend output. The regular expression that searches for markers is built with a slash as delimiter, but the marker keys were escaped without telling the escaping function about that delimiter. A key such as "foo/bar" therefore ended the pattern early, and the resulting expression either failed or matched the wrong text. Editors saw the raw marker instead of its value.

The marker keys are now escaped with the slash delimiter in mind, so every character of a key is treated as literal text. Markers containing slashes, dots or other characters with a special meaning in regular expressions are replaced like any other marker.

Markers whose key contains a slash were never replaced in the
frontend output. The regular expression that searches for markers
is built with a slash as delimiter, but the marker keys were
escaped without telling the escaping function about that
delimiter. A key such as "foo/bar" therefore ended the pattern
early, and the resulting expression either failed or matched the
wrong text. Editors saw the raw marker instead of its value.

The marker keys are now escaped with the slash delimiter in mind,
so every character of a key is treated as literal text. Markers
containing slashes, dots or other characters with a special
meaning in regular expressions are replaced like any other
marker.
@chriwo chriwo self-assigned this Sep 22, 2026
@chriwo
chriwo requested review from SomeBdyElse and s12r September 22, 2026 08:45
@chriwo
chriwo marked this pull request as ready for review September 22, 2026 08:45
@chriwo
chriwo merged commit 8c0e8cc into feature/updateV13 Sep 22, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants