passthrough

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KindPassthroughBlock = ast.NewNodeKind("PassthroughBlock")

KindPassthroughBlock is a NodeKind of the PassthroughBlock node.

View Source
var KindPassthroughInline = ast.NewNodeKind("PassthroughInline")

KindPassthroughInline is a NodeKind of the PassthroughInline node.

View Source
var PassthroughInlineTransformer = &passthroughInlineTransformer{}

Functions

func New added in v0.2.0

func New(c Config) goldmark.Extender

Types

type Config added in v0.2.0

type Config struct {
	InlineDelimiters []Delimiters
	BlockDelimiters  []Delimiters
}

Config configures this extension.

type Delimiters

type Delimiters struct {
	Open  string
	Close string
}

type PassthroughBlock

type PassthroughBlock struct {
	ast.BaseBlock
	// The matched delimiters
	Delimiters *Delimiters
}

A PassthroughBlock struct represents a fenced block of raw text to pass through unchanged. This is not parsed directly, but emitted by an ASTTransformer that splits a paragraph at the point of an inline passthrough with the matching block delimiters.

func (*PassthroughBlock) Dump

func (n *PassthroughBlock) Dump(source []byte, level int)

Dump implements Node.Dump.

func (*PassthroughBlock) Kind

func (n *PassthroughBlock) Kind() ast.NodeKind

Kind implements Node.Kind.

type PassthroughInline

type PassthroughInline struct {
	ast.BaseInline

	// The segment of text that this inline passthrough represents.
	Segment text.Segment

	// The matched delimiters
	Delimiters *Delimiters
}

PassthroughInline is a node representing a inline passthrough.

func (*PassthroughInline) Dump

func (n *PassthroughInline) Dump(source []byte, level int)

Dump implements Node.Dump.

func (*PassthroughInline) Kind

func (n *PassthroughInline) Kind() ast.NodeKind

Kind implements Node.Kind.

func (*PassthroughInline) Text

func (n *PassthroughInline) Text(source []byte) []byte

Text implements Node.Text.

Jump to

Keyboard shortcuts

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