mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-29 05:46:54 +01:00
d5058b3b20
update go min version Update Vendors: * code.gitea.io/gitea-vet v0.2.0 -> v0.2.1 * code.gitea.io/sdk/gitea v0.13.0 -> v0.13.1 * github.com/AlecAivazis/survey v2.1.1 -> v2.2.2 * github.com/adrg/xdg v0.2.1 -> v0.2.2 * github.com/araddon/dateparse d820a6159ab1 -> 8aadafed4dc4 * github.com/go-git/go-git v5.1.0 -> v5.2.0 * github.com/muesli/termenv v0.7.2 -> v0.7.4 * github.com/stretchr/testify v1.5.1 -> v1.6.1 * github.com/urfave/cli v2.2.0 -> v2.3.0 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/250 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: mrsdizzie <info@mrsdizzie.com> Co-Authored-By: 6543 <6543@noreply.gitea.io> Co-Committed-By: 6543 <6543@noreply.gitea.io>
47 lines
2.4 KiB
Go
47 lines
2.4 KiB
Go
// Package blackfriday is a markdown processor.
|
|
//
|
|
// It translates plain text with simple formatting rules into an AST, which can
|
|
// then be further processed to HTML (provided by Blackfriday itself) or other
|
|
// formats (provided by the community).
|
|
//
|
|
// The simplest way to invoke Blackfriday is to call the Run function. It will
|
|
// take a text input and produce a text output in HTML (or other format).
|
|
//
|
|
// A slightly more sophisticated way to use Blackfriday is to create a Markdown
|
|
// processor and to call Parse, which returns a syntax tree for the input
|
|
// document. You can leverage Blackfriday's parsing for content extraction from
|
|
// markdown documents. You can assign a custom renderer and set various options
|
|
// to the Markdown processor.
|
|
//
|
|
// If you're interested in calling Blackfriday from command line, see
|
|
// https://github.com/russross/blackfriday-tool.
|
|
//
|
|
// Sanitized Anchor Names
|
|
//
|
|
// Blackfriday includes an algorithm for creating sanitized anchor names
|
|
// corresponding to a given input text. This algorithm is used to create
|
|
// anchors for headings when AutoHeadingIDs extension is enabled. The
|
|
// algorithm is specified below, so that other packages can create
|
|
// compatible anchor names and links to those anchors.
|
|
//
|
|
// The algorithm iterates over the input text, interpreted as UTF-8,
|
|
// one Unicode code point (rune) at a time. All runes that are letters (category L)
|
|
// or numbers (category N) are considered valid characters. They are mapped to
|
|
// lower case, and included in the output. All other runes are considered
|
|
// invalid characters. Invalid characters that precede the first valid character,
|
|
// as well as invalid character that follow the last valid character
|
|
// are dropped completely. All other sequences of invalid characters
|
|
// between two valid characters are replaced with a single dash character '-'.
|
|
//
|
|
// SanitizedAnchorName exposes this functionality, and can be used to
|
|
// create compatible links to the anchor names generated by blackfriday.
|
|
// This algorithm is also implemented in a small standalone package at
|
|
// github.com/shurcooL/sanitized_anchor_name. It can be useful for clients
|
|
// that want a small package and don't need full functionality of blackfriday.
|
|
package blackfriday
|
|
|
|
// NOTE: Keep Sanitized Anchor Name algorithm in sync with package
|
|
// github.com/shurcooL/sanitized_anchor_name.
|
|
// Otherwise, users of sanitized_anchor_name will get anchor names
|
|
// that are incompatible with those generated by blackfriday.
|