Docsv3.31.0
Back to API Reference
Class

BackslashEscapeRule

sealed
Inherits:ParseRule

Escapes a single ASCII punctuation character preceded by \. Example: \* becomes a literal * and is protected from any other parse rule.

Remarks

Standalone rule — register via UniTextBase.AddRule without a modifier. The escapable set follows CommonMark §2.4 — all ASCII punctuation: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ Only isolated occurrences are protected. A paired inline matcher (e.g. **bold**) that started scanning before an inner \* will not respect the escape — that case requires matchers themselves to skip escaped characters when seeking their closing marker.
public int Priority{ get }
public bool IsStandalone{ get }
public string MarkupTriggers{ get }
public string TypingTriggers{ get }
public char EscapePrefix{ get }
public override int TryMatch(ReadOnlySpan<char> text, int index, PooledList<ParsedRange> results)
public override bool IsEscapable(char c)

See Also