Skip to content

fix(parser): context-aware backslash stripping#290

Merged
nlopes merged 1 commit intomainfrom
nlopes-fix-278
Jan 10, 2026
Merged

fix(parser): context-aware backslash stripping#290
nlopes merged 1 commit intomainfrom
nlopes-fix-278

Conversation

@nlopes
Copy link
Owner

@nlopes nlopes commented Jan 10, 2026

Previously, acdc always stripped the backslash from ^ and ~ escapes unconditionally. This didn't match asciidoctor's behavior which only strips the backslash when it actually prevents formatting.

For example, \^caret at a word boundary (no closing ^) should preserve the backslash as literal text, while \^super^ should strip it because it's preventing the superscript formatting.

Fixes #278

Previously, acdc always stripped the backslash from \^ and \~ escapes unconditionally.
This didn't match asciidoctor's behavior which only strips the backslash when it actually
prevents formatting.

For example, `\^caret` at a word boundary (no closing ^) should preserve the backslash as
literal text, while `\^super^` should strip it because it's preventing the superscript
formatting.

Fixes #278
@nlopes nlopes merged commit da56128 into main Jan 10, 2026
3 checks passed
@nlopes nlopes deleted the nlopes-fix-278 branch January 10, 2026 18:42
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.

Inline: Escaped characters stripped vs preserved at word boundaries

1 participant