Skip to main content

escape_mdx_outside_code_fences

Function escape_mdx_outside_code_fences 

Source
fn escape_mdx_outside_code_fences(text: &str) -> String
Expand description

Escape MDX-sensitive characters ({ and <) in plain-text regions of a Markdown document, leaving fenced code blocks (``` or ~~~) untouched.

Without this, README content with template placeholders like {FOO} or HTML-like tokens like <TOKEN> would be interpreted as MDX expressions/JSX and break vocs dev / vocs build.