parser

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmoji

func IsEmoji(value string) bool

IsEmoji reports whether value is one fully qualified Unicode emoji sequence.

func MatchGFMEmailAt

func MatchGFMEmailAt(source []byte, at, lowerBound, upperBound int) (int, int, bool)

MatchGFMEmailAt matches an extended GFM email around the @ at the given byte offset.

func NewBlockMathParser

func NewBlockMathParser() parser.BlockParser

NewBlockMathParser creates a parser for dollar-fenced flow math.

func NewInlineMathParser

func NewInlineMathParser() parser.InlineParser

NewInlineMathParser creates a parser for exact dollar-run inline math.

Types

type GFMEmailMatch

type GFMEmailMatch struct {
	Start   int
	End     int
	Address []byte
}

GFMEmailMatch is one extended GFM email autolink source range.

func FindGFMEmailMatches

func FindGFMEmailMatches(source []byte) []GFMEmailMatch

FindGFMEmailMatches finds extended GFM email autolinks in one literal text node.

type MentionMatch

type MentionMatch struct {
	// Start is the byte offset of the @ introducer within the source run.
	Start int
	// End is the exclusive byte offset of the recognized source spelling.
	End int
	// Username is the exact username without the @ introducer.
	Username []byte
}

MentionMatch is one username reference in an eligible literal-source run.

func FindMentionMatches

func FindMentionMatches(source []byte, runHasLeftBoundary bool) []MentionMatch

FindMentionMatches enumerates username references in one eligible literal-source run. Markdown structure and GFM email precedence must be resolved before calling it.

type TagMatch

type TagMatch struct {
	// Start is the byte offset of the introducer within the source run.
	Start int
	// End is the exclusive byte offset of the recognized source spelling.
	End int
	// Value is the emitted direct tag value without the introducer.
	Value []byte
}

TagMatch is one lexical tag match within an eligible literal-source run.

func FindTagMatches

func FindTagMatches(source []byte) []TagMatch

FindTagMatches enumerates tag candidates in one eligible literal-source run. Markdown structure must be resolved before calling it.

Directories

Path Synopsis
Command tagdata generates the fixed Unicode and emoji tables used by the Memos tag lexer.
Command tagdata generates the fixed Unicode and emoji tables used by the Memos tag lexer.

Jump to

Keyboard shortcuts

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