Documentation
¶
Overview ¶
Package markdownextractor provides functionality for extracting code blocks from markdown text. It supports both backtick and tilde delimited code blocks with language specifications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrUnclosedCodeBlock = errors.New("unclosed code block")
)
Common errors
Functions ¶
func ExtractMarkdownCode ¶
func ExtractMarkdownCode(markdown string, callback func(typeName string, code string, startOffset int, endOffset int)) (string, error)
ExtractMarkdownCode parses markdown text and extracts code blocks. For each code block found, it calls the callback function with: - typeName: the language/type specified for the code block - code: the content of the code block - startOffset: the starting position of the code content in the original text - endOffset: the ending position of the code content in the original text Returns the original markdown text and any error encountered during processing
Types ¶
This section is empty.