Documentation
¶
Overview ¶
Package blockutil provides shared helpers for container-style block directive parsers. Directives that open with a ":::name" fence and close with ":::" track how many nested container fences are currently open so that a closing fence is matched to the correct block.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteDepth ¶
DeleteDepth removes the depth entry for node.
func HasInnerOpenBlocks ¶
HasInnerOpenBlocks reports whether a ':'-triggered container opened after node is still open, meaning a bare closing fence belongs to that inner container rather than to node.
Types ¶
type MarkerSegment ¶ added in v1.1.0
MarkerSegment is one chunk of a paragraph split at boundary-marker lines. A marker segment carries the regex capture in Marker; a leading segment (body lines that appeared before the first marker) has IsMarker false and an empty Marker. Body holds the lines that followed, or nil when the marker was immediately followed by another marker or ended the paragraph.
func SplitParagraphAtMarkers ¶ added in v1.1.0
func SplitParagraphAtMarkers(para *ast.Paragraph, source []byte, boundary *regexp.Regexp) []MarkerSegment
SplitParagraphAtMarkers splits para at every line matching boundary, returning the resulting sequence of marker and body chunks. It returns nil when no line matches, so callers can keep using the original node.
Call this only from a block parser's Close: goldmark runs every block parser's Close during the block phase, before the separate inline pass consumes Paragraph.Lines(). Because of that ordering the line segments are still authoritative here, and the body paragraphs built below go through inline parsing normally, so markup inside them renders as HTML rather than literal text.