Fix Pedantic

This commit is contained in:
Trevor Buckner 2020-05-29 20:53:58 -04:00
parent 283ab9cf8a
commit c38ee23f45
13 changed files with 38 additions and 1 deletions

View File

@ -229,7 +229,7 @@ inline.normal = merge({}, inline);
inline.pedantic = merge({}, inline.normal, { inline.pedantic = merge({}, inline.normal, {
strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, em: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
link: edit(/^!?\[(label)\]\((.*?)\)/) link: edit(/^!?\[(label)\]\((.*?)\)/)
.replace('label', inline._label) .replace('label', inline._label)
.getRegex(), .getRegex(),

View File

@ -53,3 +53,5 @@ runSpecs('Original', './original', false, { gfm: false, pedantic: true });
runSpecs('New', './new'); runSpecs('New', './new');
runSpecs('ReDOS', './redos'); runSpecs('ReDOS', './redos');
runSpecs('Security', './security', false, { silent: true }); // silent - do not show deprecation warning runSpecs('Security', './security', false, { silent: true }); // silent - do not show deprecation warning
//runSpecs('Whats', './whats');

View File

@ -0,0 +1,4 @@
<p>[<em>[punctuation, asterisk, punctuation should work</em></p>
<p><em>[space, asterisk, punctuation should work</em></p>
<p>p<em>non-punctuation, asterisk, non-punctuation should work</em></p>
<p>p*[non-punctuation, asterisk, punctuation should NOT work*</p>

View File

@ -0,0 +1,10 @@
[*[punctuation, asterisk, punctuation should work*
*[space, asterisk, punctuation should work*
p*non-punctuation, asterisk, non-punctuation should work*
p*[non-punctuation, asterisk, punctuation should NOT work*

View File

@ -0,0 +1 @@
<p><em>foo <em>bar</em></em></p>

View File

@ -0,0 +1 @@
*foo *bar**

View File

@ -0,0 +1 @@
<p><em>foo <strong>bar</strong> baz</em></p>

View File

@ -0,0 +1 @@
*foo **bar** baz*

View File

@ -0,0 +1 @@
<p>foo <em>_</em></p>

View File

@ -0,0 +1 @@
<p><em>(<strong>foo</strong>)</em></p>

View File

@ -0,0 +1 @@
*(**foo**)*

View File

@ -0,0 +1,7 @@
<p><strong><em>This is strong and em.</em></strong></p>
<p>So is <strong><em>this</em></strong> word.</p>
<p><strong><em>This is strong and em.</em></strong></p>
<p>So is <strong><em>this</em></strong> word.</p>

View File

@ -0,0 +1,7 @@
***This is strong and em.***
So is ***this*** word.
___This is strong and em.___
So is ___this___ word.