Skip to main content

sanitize_prose_links

Function sanitize_prose_links 

Source
fn sanitize_prose_links(lines: &[&str], links: Neutralize) -> String
Expand description

sanitize_roxygen_links over prose lines, one paragraph (the lines between blank lines) at a time, joined back with their line breaks.

A link whose text and target sit on two lines of one paragraph is still found. CommonMark code spans do not cross a blank line, so an unbalanced backtick cannot switch neutralizing off beyond its paragraph. A fenced block (``` or ~~~, blank lines included) is code and passes through untouched, so x[i] there is never rewritten.