mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
LibMarkdown: Handle delimiter flanking with punctuation
This patch handles the following two rules 1) A delimiter run is either (a) not followed by a Unicode punctuation character, or (b) followed by a Unicode punctuation character and preceded by Unicode whitespace or a Unicode punctuation character. 2) A _ can be used to open/close a delimiter run if it's (a) not part of a left-flanking delimiter run or (b) part of a left-flanking delimiter run followed by a Unicode punctuation character.
This commit is contained in:
parent
d28459fb11
commit
af5a07399e
2 changed files with 41 additions and 14 deletions
|
@ -111,6 +111,8 @@ private:
|
|||
// definition, see the CommonMark spec.
|
||||
bool left_flanking;
|
||||
bool right_flanking;
|
||||
bool punct_before;
|
||||
bool punct_after;
|
||||
// is_run indicates that this token is a 'delimiter run'. A delimiter
|
||||
// run occurs when several of the same sytactical character ('`', '_',
|
||||
// or '*') occur in a row.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue