Skip to main content

code_span_ranges_without_math

Function code_span_ranges_without_math 

Source
pub fn code_span_ranges_without_math(content: &str) -> Vec<(usize, usize)>
Expand description

The byte ranges of the code spans in content as a reader without math finds them, sorted by start.

rumdl reads $...$ and $$...$$ as math, and a backtick inside math opens no code span. CommonMark has no math, and there that backtick opens a span closing at the next backtick run of its length, inside the math or past it. A rewrite that has to keep a code span’s text as written needs both readings, so this one comes from the same parse with only math left out.