Skip to main content

guard_djot_block_start

Function guard_djot_block_start 

Source
pub fn guard_djot_block_start(s: &str) -> String
Expand description

Neutralise a line’s leading characters so they are not parsed as a block-construct marker.

Covers the block-only markers (#, >, -, +, :) and the ordered-list forms <digits>. and <digits>). Inline specials are escape_djot_inline’s job.

For the ordered-list case the delimiter is escaped rather than the digit: a backslash before a digit is a literal backslash in Djot, so escaping 1 in 1. would add a visible \ and still leave the list marker intact — wrong twice over.