The goal of this change is to reduce number of non-standard library
packages (repositories) that blackfriday imports (not counting imports
used only for tests) from 1 to 0, and in turn, reduce the cost of
importing blackfriday into other projects.
Do so by documenting the algorithm of SanitizedAnchorName, and include
a copy of the small function inside blackfriday itself. The same
functionality continues to be available in the original location,
github.com/shurcooL/sanitized_anchor_name.Create. It can be used by
existing users and those that look for a small package, and don't need
all of blackfriday functionality. Existing users of blackfriday can use
the new SanitizedAnchorName function directly and avoid an extra
package import.
This change is a port of PR #352 from v1 into v2.
Updates #348.
Updates #350.
We do not have a single go statement in Blackfriday code, -race does
nothing for us, but burn CPU cycles (and it hurts because we're hitting
timeouts on full test runs).
The old regex missed a lot of HTML entities, like long references
(from 6-character entites like ≈ to the somewhat rarer
∳) as well as numeric references
(decimal e.g. Ӓ or hex e.g. 𓫶). This fixes that.
* Add full info string in fenced code blocks
According to common mark, the info string for a fenced code block can be any
non-whitespace string, so adjust the code to read a full string instead of
just the syntax name.
Fixes#410 in v2.
* run go fmt
Unexport a bunch of constants private to HTML renderer
They were cluttering the documentation and are not useful otherwise.
Rearrange constants in descending dependencies order
Improve Renderer to be less confusing. Fix documentation for it.
OmitContents flag got dropped along the way. First, it would fit poorly
into the new design and second, it's unclear how widely this feature is
used. But most importantly, it's trivial to roll your own with the v2
API: https://gist.github.com/rtfb/2693f6bfcc1760661e8d2fb832763a15Fixes#368.