annotate vendor/github.com/russross/blackfriday/v2/doc.go @ 81:6ce24b93c8d0 draft

I keep inserting random bugs Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author yakumo.izuru
date Tue, 12 Dec 2023 14:27:29 +0000
parents 787b5ee0289d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
66
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
1 // Package blackfriday is a markdown processor.
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
2 //
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
3 // It translates plain text with simple formatting rules into an AST, which can
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
4 // then be further processed to HTML (provided by Blackfriday itself) or other
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
5 // formats (provided by the community).
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
6 //
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
7 // The simplest way to invoke Blackfriday is to call the Run function. It will
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
8 // take a text input and produce a text output in HTML (or other format).
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
9 //
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
10 // A slightly more sophisticated way to use Blackfriday is to create a Markdown
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
11 // processor and to call Parse, which returns a syntax tree for the input
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
12 // document. You can leverage Blackfriday's parsing for content extraction from
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
13 // markdown documents. You can assign a custom renderer and set various options
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
14 // to the Markdown processor.
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
15 //
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
16 // If you're interested in calling Blackfriday from command line, see
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
17 // https://github.com/russross/blackfriday-tool.
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
18 //
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
19 // Sanitized Anchor Names
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
20 //
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
21 // Blackfriday includes an algorithm for creating sanitized anchor names
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
22 // corresponding to a given input text. This algorithm is used to create
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
23 // anchors for headings when AutoHeadingIDs extension is enabled. The
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
24 // algorithm is specified below, so that other packages can create
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
25 // compatible anchor names and links to those anchors.
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
26 //
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
27 // The algorithm iterates over the input text, interpreted as UTF-8,
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
28 // one Unicode code point (rune) at a time. All runes that are letters (category L)
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
29 // or numbers (category N) are considered valid characters. They are mapped to
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
30 // lower case, and included in the output. All other runes are considered
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
31 // invalid characters. Invalid characters that precede the first valid character,
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
32 // as well as invalid character that follow the last valid character
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
33 // are dropped completely. All other sequences of invalid characters
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
34 // between two valid characters are replaced with a single dash character '-'.
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
35 //
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
36 // SanitizedAnchorName exposes this functionality, and can be used to
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
37 // create compatible links to the anchor names generated by blackfriday.
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
38 // This algorithm is also implemented in a small standalone package at
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
39 // github.com/shurcooL/sanitized_anchor_name. It can be useful for clients
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
40 // that want a small package and don't need full functionality of blackfriday.
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
41 package blackfriday
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
42
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
43 // NOTE: Keep Sanitized Anchor Name algorithm in sync with package
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
44 // github.com/shurcooL/sanitized_anchor_name.
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
45 // Otherwise, users of sanitized_anchor_name will get anchor names
787b5ee0289d Use vendored modules
yakumo.izuru
parents:
diff changeset
46 // that are incompatible with those generated by blackfriday.