Skip to main content

process_emphasis_in_range

Function process_emphasis_in_range 

Source
pub fn process_emphasis_in_range(
    events: &mut [IrEvent],
    lo: usize,
    hi: usize,
    dialect: Dialect,
)
Expand description

Range-scoped variant of process_emphasis.

Only delim runs whose IR event index lies in [lo, hi) are considered. Used by build_full_plans to run emphasis pairing inside each resolved bracket pair before the global top-level pass, so emphasis can never form across a link’s bracket boundary (CommonMark §6.3 requires bracket resolution to happen first when at a ], with emphasis processed on the link’s inner range).

The function additionally skips delim runs that already carry a recorded match in their matches vec — this lets the second (top-level) pass reuse the same algorithm without re-pairing bytes already consumed by inner-range passes.