Skip to main content

neutralize_esm

Function neutralize_esm 

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

Neutralize any line MDX would parse as an ESM statement (import or export at column one): the keyword’s prefix becomes HTML entities, so the line renders the same but no longer begins with an ESM token. NatSpec text can be inherited from a dependency via @inheritdoc, so this must run wherever displayed prose is assembled. A keyword that falls inside a Markdown code span or fenced code block is left untouched (see code_regions): the entity would render literally and corrupt the example, and MDX would not execute it there.