Documentation
¶
Overview ¶
Package fencepos answers "where in the source does a fenced code block's opening and closing fence line sit, and what fence character did the author use?" The helpers here let any rule reason about the raw fence delimiters of a *ast.FencedCodeBlock without owning that scanning logic itself.
Index ¶
- func CharAt(src []byte, pos int) byte
- func CloseLine(f *lint.File, fcb *ast.FencedCodeBlock) int
- func CloseLineRange(src []byte, fcb *ast.FencedCodeBlock, openEnd int) (int, int)
- func OpenLine(f *lint.File, fcb *ast.FencedCodeBlock) int
- func OpenLineRange(src []byte, fcb *ast.FencedCodeBlock) (int, int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CharAt ¶
CharAt returns the fence character at the given position, skipping leading spaces. Returns 0 when no fence character (` or ~) follows.
func CloseLine ¶
func CloseLine(f *lint.File, fcb *ast.FencedCodeBlock) int
CloseLine returns the 1-based line number of the closing fence.
func CloseLineRange ¶
CloseLineRange returns the byte range [start, end) of the closing fence line (without trailing newline). openEnd is the byte offset returned by OpenLineRange for the same block.
func OpenLine ¶
func OpenLine(f *lint.File, fcb *ast.FencedCodeBlock) int
OpenLine returns the 1-based line number of the opening fence.
func OpenLineRange ¶
func OpenLineRange(src []byte, fcb *ast.FencedCodeBlock) (int, int)
OpenLineRange returns the byte range [start, end) of the opening fence line (without trailing newline).
Types ¶
This section is empty.