diff --git a/src/rules.js b/src/rules.js index 268d0cf29a..8877852d54 100644 --- a/src/rules.js +++ b/src/rules.js @@ -169,7 +169,7 @@ const inline = { reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\[\*])\*(?![\]`punctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^_([^\s_<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s*<\[])\*(?!\*)|^\*([^\s<"][\s\S]*?[^\s\[\*])\*(?![\]`punctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br: /^( {2,}|\\)\n(?!\s*$)/, del: noopTest, diff --git a/test/specs/new/em_2char.html b/test/specs/new/em_2char.html index 56db779ccb..eb49036249 100644 --- a/test/specs/new/em_2char.html +++ b/test/specs/new/em_2char.html @@ -24,4 +24,6 @@

1*

-

It’s leviOHsa, not levioSAH.

\ No newline at end of file +

It’s leviOHsa, not levioSAH.

+ +

__ test test

\ No newline at end of file diff --git a/test/specs/new/em_2char.md b/test/specs/new/em_2char.md index ef8e636657..da34739179 100644 --- a/test/specs/new/em_2char.md +++ b/test/specs/new/em_2char.md @@ -25,3 +25,5 @@ _1__ *1** It’s levi*OH*sa, not levio*SAH.* + +__ test [test](https://test.com/_)