Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
File string `json:"file"`
Line int `json:"line"`
Tag string `json:"tag"`
Message string `json:"message"`
Level string `json:"level"` // "warning" or "error"
}
Diagnostic represents a syntax issue found in a markdown file.
func Check ¶
func Check(filename string, content []byte, lineOffset int) []Diagnostic
Check scans markdown content for unclosed, mismatched or malformed ":::" fences. It follows the renderer's rules (the fence package, shared with the block parsers): a bare ":::" closes the innermost open block, ":::/name" closes the nearest open block that name closes and takes any inner block left open with it, and a ":::/name" that matches no open block is content. Lines inside fenced code blocks (``` or ~~~) are skipped. lineOffset is added to all reported line numbers (use page.FrontmatterLines when checking RawContent that has frontmatter stripped).
Click to show internal directories.
Click to hide internal directories.