extension

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 8 Imported by: 0

README

Documentation Test Status Coverage Status Report Card

goldmark-SuperSubscript

This Go module contains two extensions for the Markdown parser Goldmark providing super- and subscripts.

Syntax

Similar to markdown-it the new markup characters are:

  • The circumflex ^ for superscript

  • The tilde ~ for subscript

We need to place one before and one after the text segment like H~2~O or x^2^.

No whitespace between the two surrounding markup characters is allowed. This way the common slip using TeX syntax like x^2 + x^5 does not lead to messed up HTML. In case we definitely want to insert space we need to place a non-breaking space—either directly or as the HTML entity  .

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Subscript = &subscript{}

Subscript is an extension that allows you to use a subscript expression like 'x~0~'.

View Source
var SubscriptAttributeFilter = html.GlobalAttributeFilter

SubscriptAttributeFilter defines attribute names which dd elements can have.

View Source
var Superscript = &superscript{}

Superscript is an extension that allows you to use a superscript expression like 'x^2^'.

View Source
var SuperscriptAttributeFilter = html.GlobalAttributeFilter

SuperscriptAttributeFilter defines attribute names which dd elements can have.

Functions

func NewSubscriptHTMLRenderer

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

NewSubscriptHTMLRenderer returns a new SubscriptHTMLRenderer.

func NewSubscriptParser

func NewSubscriptParser() parser.InlineParser

NewSubscriptParser return a new InlineParser that parses subscript expressions.

func NewSuperscriptHTMLRenderer

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

NewSuperscriptHTMLRenderer returns a new SuperscriptHTMLRenderer.

func NewSuperscriptParser

func NewSuperscriptParser() parser.InlineParser

NewSuperscriptParser return a new InlineParser that parses superscript expressions.

Types

type SubscriptHTMLRenderer

type SubscriptHTMLRenderer struct {
	html.Config
}

SubscriptHTMLRenderer is a renderer.NodeRenderer implementation that renders Subscript nodes.

func (*SubscriptHTMLRenderer) RegisterFuncs

RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs.

type SuperscriptHTMLRenderer

type SuperscriptHTMLRenderer struct {
	html.Config
}

SuperscriptHTMLRenderer is a renderer.NodeRenderer implementation that renders Superscript nodes.

func (*SuperscriptHTMLRenderer) RegisterFuncs

RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs.

Directories

Path Synopsis
Package ast defines AST nodes that represents extension's elements
Package ast defines AST nodes that represents extension's elements

Jump to

Keyboard shortcuts

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