markdown

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToHTML

func ToHTML(src string, style Style) template.HTML

Types

type NoEscapeCodeBlockRenderer added in v1.0.3

type NoEscapeCodeBlockRenderer struct {
	html.Config
}

NoEscapeCodeBlockRenderer is a renderer.NodeRenderer implementation that renders code blocks without escaping HTML special characters.

This is needed in lintian-ssg because the tag description are not really Markdown conformant. They are over-escaped inside code blocks, which means that another pass of escaping will not produce the expected result.

Specifically, Lintian tags explanation have had their underscores (_) replaced by _ in lintian#d590cbf22, as well as some other special chars, apparently to fix the HTML output. Escaping them once more, as the default CodeBlock renderer would do it, would result in _ being displayed in the code block instead of the expected underscore (_).

This renderer could be removed once the tag descriptions are fixed to use conformant Markdown.

func NewNoEscapeCodeBlockRenderer added in v1.0.3

func NewNoEscapeCodeBlockRenderer() *NoEscapeCodeBlockRenderer

NewNoEscapeCodeBlockRenderer returns a new NoEscapeCodeBlockRenderer.

func (*NoEscapeCodeBlockRenderer) RegisterFuncs added in v1.0.3

RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs.

type Style

type Style int
const (
	StyleInline Style = iota
	StyleFull
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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