attributes

package module
v0.0.0-...-6883396 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 10 Imported by: 0

README

goldmark-inline-attributes

GoldMark inline attributes extension.

This implements the bracketed_spans of pandoc.

[This is *some text*]{.class key="val"} outside text
<p><span class="class" key="val">This is <em>some text</em></span> outside text</p>
var md = goldmark.New(attributes.Enable)
var source = []byte("[Text]{#id .class1}\nother text")
err := md.Convert(source, os.Stdout)
if err != nil {
    log.Fatal(err)
}

Documentation

Index

Constants

This section is empty.

Variables

Enable is a goldmark.Option with inline attributes support.

Extension is a goldmark.Extender with markdown inline attributes support.

View Source
var Kind = ast.NewNodeKind("InlineAttributes")

Kind is the kind of hashtag AST nodes.

Functions

func NewAttributesParser

func NewAttributesParser() parser.InlineParser

NewAttributesParser return a new InlineParser that parses inline attributes like '[txt]{.underline}' .

Types

type Extender

type Extender struct{}

func (*Extender) Extend

func (e *Extender) Extend(m goldmark.Markdown)

type Node

type Node struct {
	ast.BaseInline
}

Node is a parsed attributes node.

func (*Node) Dump

func (n *Node) Dump(src []byte, level int)

func (*Node) Kind

func (*Node) Kind() ast.NodeKind

Jump to

Keyboard shortcuts

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