Documentation
¶
Index ¶
- func FenceCharAt(src []byte, pos int) byte
- func FenceCloseLine(f *lint.File, fcb *ast.FencedCodeBlock) int
- func FenceCloseLineRange(src []byte, fcb *ast.FencedCodeBlock, openEnd int) (int, int)
- func FenceLines(src []byte, fcb *ast.FencedCodeBlock) (openStart, openEnd, closeStart, closeEnd int)
- func FenceOpenLine(f *lint.File, fcb *ast.FencedCodeBlock) int
- func FenceOpenLineRange(src []byte, fcb *ast.FencedCodeBlock) (int, int)
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FenceCharAt ¶ added in v0.4.0
FenceCharAt returns the fence character at the given position, skipping leading spaces.
func FenceCloseLine ¶
func FenceCloseLine(f *lint.File, fcb *ast.FencedCodeBlock) int
FenceCloseLine returns the 1-based line number of the closing fence.
func FenceCloseLineRange ¶
FenceCloseLineRange is an exported wrapper for tests.
func FenceLines ¶
func FenceLines(src []byte, fcb *ast.FencedCodeBlock) (openStart, openEnd, closeStart, closeEnd int)
FenceLines returns a helper for getting the line ranges used by other rules.
func FenceOpenLine ¶
func FenceOpenLine(f *lint.File, fcb *ast.FencedCodeBlock) int
FenceOpenLine returns the 1-based line number of the opening fence.
func FenceOpenLineRange ¶
func FenceOpenLineRange(src []byte, fcb *ast.FencedCodeBlock) (int, int)
FenceOpenLineRange is an exported wrapper for tests.
Types ¶
type Rule ¶
type Rule struct {
Style string // "backtick" or "tilde"
}
Rule checks that fenced code blocks use a consistent fence style. Default style is "backtick". Set Style to "tilde" for tilde fences.
func (*Rule) ApplySettings ¶
ApplySettings implements rule.Configurable.
func (*Rule) Check ¶
func (r *Rule) Check(f *lint.File) []lint.Diagnostic
Check implements rule.Rule.
func (*Rule) DefaultSettings ¶
DefaultSettings implements rule.Configurable.