astutil

package
v0.13.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractText

func ExtractText(n ast.Node, source []byte, buf *bytes.Buffer)

ExtractText recursively writes the text content of n and its descendants into buf.

func HeadingLine

func HeadingLine(heading *ast.Heading, f *lint.File) int

HeadingLine returns the 1-based source line of a heading node. Setext headings expose their line via Lines(); ATX headings are found by walking inline descendants until the first text segment. Returns 1 as a safe fallback.

func HeadingText

func HeadingText(heading *ast.Heading, source []byte) string

HeadingText returns the plain-text content of a heading by recursively extracting all text segments from its children.

func IsTable

func IsTable(para *ast.Paragraph, f *lint.File) bool

IsTable reports whether a paragraph node is actually a GFM table (goldmark parses tables as paragraphs when the table extension is absent). It checks whether the first line starts with "|".

func ParagraphLine

func ParagraphLine(para *ast.Paragraph, f *lint.File) int

ParagraphLine returns the 1-based source line of a paragraph node.

Types

This section is empty.

Jump to

Keyboard shortcuts

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