Fences
fences
Shared fenced-code-block primitive for markdown-aware strategies.
Factors out the backreference fence regex that was previously duplicated
across :mod:collapse_whitespace, :mod:strip_html_comments and
:mod:compact_tables. Capturing the opening backtick run and closing on
the exact same length means a 4-backtick fence is not closed by an inner
3-backtick line.
fenced_line_indices(text)
Return indices of lines that fall inside a fenced code block.
Lines are indexed as produced by text.split("\n"). Both fence
delimiter lines and the content between them are included.