gitea: code.gitea.io/gitea/modules/markup/common Index | Files

package common

import "code.gitea.io/gitea/modules/markup/common"

Index

Package Files

footnote.go html.go linkify.go

Variables

var FootnoteExtension = &footnoteExtension{}

FootnoteExtension represents the Gitea Footnote

var KindFootnote = ast.NewNodeKind("GiteaFootnote")

KindFootnote is a NodeKind of the Footnote node.

var KindFootnoteBackLink = ast.NewNodeKind("GiteaFootnoteBackLink")

KindFootnoteBackLink is a NodeKind of the FootnoteBackLink node.

var KindFootnoteLink = ast.NewNodeKind("GiteaFootnoteLink")

KindFootnoteLink is a NodeKind of the FootnoteLink node.

var KindFootnoteList = ast.NewNodeKind("GiteaFootnoteList")

KindFootnoteList is a NodeKind of the FootnoteList node.

var (

    // LinkRegex is a regexp matching a valid link
    LinkRegex, _ = xurls.StrictMatchingScheme("https?://")
)
var Linkify = &linkify{}

Linkify is an extension that allow you to parse text that seems like a URL.

func CleanValue Uses

func CleanValue(value []byte) []byte

CleanValue will clean a value to make it safe to be an id This function is quite different from the original goldmark function and more closely matches the output from the shurcooL sanitizer In particular Unicode letters and numbers are a lot more than a-zA-Z0-9...

func NewFootnoteASTTransformer Uses

func NewFootnoteASTTransformer() parser.ASTTransformer

NewFootnoteASTTransformer returns a new parser.ASTTransformer that insert a footnote list to the last of the document.

func NewFootnoteBlockParser Uses

func NewFootnoteBlockParser() parser.BlockParser

NewFootnoteBlockParser returns a new parser.BlockParser that can parse footnotes of the Markdown(PHP Markdown Extra) text.

func NewFootnoteHTMLRenderer Uses

func NewFootnoteHTMLRenderer(opts ...html.Option) renderer.NodeRenderer

NewFootnoteHTMLRenderer returns a new FootnoteHTMLRenderer.

func NewFootnoteParser Uses

func NewFootnoteParser() parser.InlineParser

NewFootnoteParser returns a new parser.InlineParser that can parse footnote links of the Markdown(PHP Markdown Extra) text.

func NewLinkifyParser Uses

func NewLinkifyParser() parser.InlineParser

NewLinkifyParser return a new InlineParser can parse text that seems like a URL.

type Footnote Uses

type Footnote struct {
    ast.BaseBlock
    Ref   []byte
    Index int
    Name  []byte
}

A Footnote struct represents a footnote of Markdown (PHP Markdown Extra) text.

func NewFootnote Uses

func NewFootnote(ref []byte) *Footnote

NewFootnote returns a new Footnote node.

func (*Footnote) Dump Uses

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

Dump implements Node.Dump.

func (*Footnote) Kind Uses

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

Kind implements Node.Kind.

type FootnoteBackLink struct {
    ast.BaseInline
    Index int
    Name  []byte
}

A FootnoteBackLink struct represents a link to a footnote of Markdown (PHP Markdown Extra) text.

func NewFootnoteBackLink(index int, name []byte) *FootnoteBackLink

NewFootnoteBackLink returns a new FootnoteBackLink node.

func (*FootnoteBackLink) Dump Uses

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

Dump implements Node.Dump.

func (*FootnoteBackLink) Kind Uses

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

Kind implements Node.Kind.

type FootnoteHTMLRenderer Uses

type FootnoteHTMLRenderer struct {
    html.Config
}

FootnoteHTMLRenderer is a renderer.NodeRenderer implementation that renders FootnoteLink nodes.

func (*FootnoteHTMLRenderer) RegisterFuncs Uses

func (r *FootnoteHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)

RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs.

type FootnoteLink struct {
    ast.BaseInline
    Index int
    Name  []byte
}

A FootnoteLink struct represents a link to a footnote of Markdown (PHP Markdown Extra) text.

func NewFootnoteLink(index int, name []byte) *FootnoteLink

NewFootnoteLink returns a new FootnoteLink node.

func (*FootnoteLink) Dump Uses

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

Dump implements Node.Dump.

func (*FootnoteLink) Kind Uses

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

Kind implements Node.Kind.

type FootnoteList Uses

type FootnoteList struct {
    ast.BaseBlock
    Count int
}

A FootnoteList struct represents footnotes of Markdown (PHP Markdown Extra) text.

func NewFootnoteList Uses

func NewFootnoteList() *FootnoteList

NewFootnoteList returns a new FootnoteList node.

func (*FootnoteList) Dump Uses

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

Dump implements Node.Dump.

func (*FootnoteList) Kind Uses

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

Kind implements Node.Kind.

Package common imports 14 packages (graph) and is imported by 12 packages. Updated 2021-01-03. Refresh now. Tools for package owners.