syntax

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 3 Imported by: 0

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL