Skip to main content

mask_code_spans

Function mask_code_spans 

Source
pub fn mask_code_spans(body: &str) -> String
Expand description

_masked_code_spans: every span blanked to spaces, same length out as in.

“Same length” is Python’s, and Python counts characters: the replacement is ' ' * len(match.group()). A span holding non-ASCII therefore masks to fewer bytes than it occupied, and a caller reasoning about columns is reasoning about the same columns Python would.