Skip to main content

wrap_orphan_brackets_in_place

Function wrap_orphan_brackets_in_place 

Source
fn wrap_orphan_brackets_in_place(html: &str) -> String
Expand description

Find every [#…] in html that lives outside an HTML tag and outside an existing afm-annotation wrapper, and wrap it in a hidden <span class="afm-annotation" hidden>…</span>. The class name matches aozora-render’s annotation wrapper so test_support::strip_annotation_wrappers continues to recognise it, and the pass is idempotent: a second invocation finds the afm-annotation substring in the prefix and skips re-wrapping.