passthrough – github.com/gohugoio/hugo-goldmark-extensions/passthrough Index | Files

package passthrough

import "github.com/gohugoio/hugo-goldmark-extensions/passthrough"

Index

Variables

var KindPassthroughBlock = ast.NewNodeKind("PassthroughBlock")

KindPassthroughBlock is a NodeKind of the PassthroughBlock node.

var KindPassthroughInline = ast.NewNodeKind("PassthroughInline")

KindPassthroughInline is a NodeKind of the PassthroughInline node.

var PassthroughInlineTransformer = &passthroughInlineTransformer{}

Functions

func New

func New(c Config) goldmark.Extender

Types

type Config

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. Deprecated: Goldmark v1.7.8 deprecates Node.Text

Source Files

passthrough.go

Version
v0.3.1 (latest)
Published
Mar 30, 2025
Platform
js/wasm
Imports
9 packages
Last checked
now

Tools for package owners.