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.
The check was introduced with d28de22, when fixing #172 and #173.
Then I removed it with bcd6dd8 when fixing #180
And then it was reintroduced with 232d06c when fixing regression.
It seems that the check can be removed again. All these cases now have
tests (including the one from 69f51af, which seems to have landed to v1
only, copying it here) and they all pass.
The root problem this commit fixes is the duplication of Extensions
field in HTMLRendererParameters. The duplication crept in there only to
support these two flags, so moving the flags solves the problem. They're
only used in renderer anyway.
Fixes#277.
* Move handler call inside the inner loop's 'if handler != nil' clause
* Move appender of possible tail bytes outside of loop
* Get rid of outer loop
* Rename i -> beg
Again, this does not seem to gain much performance, but makes the code
significantly more readable.
Rearrange inline parser a little bit to check less conditionals for
every byte.
* Add early check for len(data) == 0
* Move 'for i < len(data)' check inside the (rarer) positive clause of
trigger result handling
* A check for newline turned out to be redundant
* Look up p.inlineCallback only once
All that does not gain much performance in itself, but doesn't hurt and
makes the code structure simpler, which will hopefully allow further
streamlining.