diff --git a/src/Lexer.js b/src/Lexer.js index b961706ee7..bef990b5bc 100644 --- a/src/Lexer.js +++ b/src/Lexer.js @@ -319,9 +319,29 @@ module.exports = class Lexer { /** * Lexing/Compiling */ - inlineTokens(src, tokens = [], inLink = false, inRawBlock = false) { + inlineTokens(src, tokens = [], inLink = false, inRawBlock = false, prevChar = '') { let token; + // String with links masked to avoid interference with em and strong + let maskedSrc = src; + let match; + + // Mask out reflinks + if (this.tokens.links) { + const links = Object.keys(this.tokens.links); + if (links.length > 0) { + while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { + if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) { + maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); + } + } + } + } + // Mask out other blocks + while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { + maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); + } + while (src) { // escape if (token = this.tokenizer.escape(src)) { @@ -360,7 +380,7 @@ module.exports = class Lexer { } // strong - if (token = this.tokenizer.strong(src)) { + if (token = this.tokenizer.strong(src, maskedSrc, prevChar)) { src = src.substring(token.raw.length); token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock); tokens.push(token); @@ -368,7 +388,7 @@ module.exports = class Lexer { } // em - if (token = this.tokenizer.em(src)) { + if (token = this.tokenizer.em(src, maskedSrc, prevChar)) { src = src.substring(token.raw.length); token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock); tokens.push(token); @@ -414,6 +434,7 @@ module.exports = class Lexer { // text if (token = this.tokenizer.inlineText(src, inRawBlock, smartypants)) { src = src.substring(token.raw.length); + prevChar = token.raw.slice(-1); tokens.push(token); continue; } diff --git a/src/Tokenizer.js b/src/Tokenizer.js index 9b548be14d..126cfb2f70 100644 --- a/src/Tokenizer.js +++ b/src/Tokenizer.js @@ -490,25 +490,49 @@ module.exports = class Tokenizer { } } - strong(src) { - const cap = this.rules.inline.strong.exec(src); - if (cap) { - return { - type: 'strong', - raw: cap[0], - text: cap[4] || cap[3] || cap[2] || cap[1] - }; + strong(src, maskedSrc, prevChar = '') { + let match = this.rules.inline.strong.start.exec(src); + + if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) { + maskedSrc = maskedSrc.slice(-1 * src.length); + const endReg = match[0] === '**' ? this.rules.inline.strong.endAst : this.rules.inline.strong.endUnd; + + endReg.lastIndex = 0; + + let cap; + while ((match = endReg.exec(maskedSrc)) != null) { + cap = this.rules.inline.strong.middle.exec(maskedSrc.slice(0, match.index + 3)); + if (cap) { + return { + type: 'strong', + raw: src.slice(0, cap[0].length), + text: src.slice(2, cap[0].length - 2) + }; + } + } } } - em(src) { - const cap = this.rules.inline.em.exec(src); - if (cap) { - return { - type: 'em', - raw: cap[0], - text: cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1] - }; + em(src, maskedSrc, prevChar = '') { + let match = this.rules.inline.em.start.exec(src); + + if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) { + maskedSrc = maskedSrc.slice(-1 * src.length); + const endReg = match[0] === '*' ? this.rules.inline.em.endAst : this.rules.inline.em.endUnd; + + endReg.lastIndex = 0; + + let cap; + while ((match = endReg.exec(maskedSrc)) != null) { + cap = this.rules.inline.em.middle.exec(maskedSrc.slice(0, match.index + 2)); + if (cap) { + return { + type: 'em', + raw: src.slice(0, cap[0].length), + text: src.slice(1, cap[0].length - 1) + }; + } + } } } diff --git a/src/rules.js b/src/rules.js index 79615b64cd..a4046ee359 100644 --- a/src/rules.js +++ b/src/rules.js @@ -168,19 +168,74 @@ const inline = { link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, - strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^_([^\s_<][\s\S]*?[^\s_])_(?!_|[^\s,punctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\s,punctuation])|^\*([^\s*<\[])\*(?!\*)|^\*([^\s<"][\s\S]*?[^\s\[\*])\*(?![\]`punctuation])|^\*([^\s*"<\[][\s\S]*[^\s])\*(?!\*)/, + reflinkSearch: 'reflink|nolink(?!\\()', + strong: { + start: /^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/, // (1) returns if starts w/ punctuation + middle: /^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/, + endAst: /[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/, // last char can't be punct, or final * must also be followed by punct (or endline) + endUnd: /[^\s]__(?!_)(?:(?=[punctuation\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline) + }, + em: { + start: /^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/, // (1) returns if starts w/ punctuation + middle: /^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/, + endAst: /[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/, // last char can't be punct, or final * must also be followed by punct (or endline) + endUnd: /[^\s]_(?!_)(?:(?=[punctuation\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline) + }, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br: /^( {2,}|\\)\n(?!\s*$)/, del: noopTest, - text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~'; -inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex(); +// without * and _ to workaround cases with double emphasis +inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~'; +inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); + +// sequences em should skip over [title](link), `code`, +inline._blockSkip = '\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>'; +inline._overlapSkip = '__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*'; + +inline.em.start = edit(inline.em.start) + .replace(/punctuation/g, inline._punctuation) + .getRegex(); + +inline.em.middle = edit(inline.em.middle) + .replace(/punctuation/g, inline._punctuation) + .replace(/overlapSkip/g, inline._overlapSkip) + .getRegex(); + +inline.em.endAst = edit(inline.em.endAst, 'g') + .replace(/punctuation/g, inline._punctuation) + .getRegex(); + +inline.em.endUnd = edit(inline.em.endUnd, 'g') + .replace(/punctuation/g, inline._punctuation) + .getRegex(); + +inline.strong.start = edit(inline.strong.start) + .replace(/punctuation/g, inline._punctuation) + .getRegex(); + +inline.strong.middle = edit(inline.strong.middle) + .replace(/punctuation/g, inline._punctuation) + .replace(/blockSkip/g, inline._blockSkip) + .getRegex(); + +inline.strong.endAst = edit(inline.strong.endAst, 'g') + .replace(/punctuation/g, inline._punctuation) + .getRegex(); + +inline.strong.endUnd = edit(inline.strong.endUnd, 'g') + .replace(/punctuation/g, inline._punctuation) + .getRegex(); + +inline.blockSkip = edit(inline._blockSkip, 'g') + .getRegex(); + +inline.overlapSkip = edit(inline._overlapSkip, 'g') + .getRegex(); inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; @@ -212,6 +267,11 @@ inline.reflink = edit(inline.reflink) .replace('label', inline._label) .getRegex(); +inline.reflinkSearch = edit(inline.reflinkSearch, 'g') + .replace('reflink', inline.reflink) + .replace('nolink', inline.nolink) + .getRegex(); + /** * Normal Inline Grammar */ @@ -223,8 +283,18 @@ inline.normal = merge({}, inline); */ inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, + strong: { + start: /^__|\*\*/, + middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + endAst: /\*\*(?!\*)/g, + endUnd: /__(?!_)/g + }, + em: { + start: /^_|\*/, + middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/, + endAst: /\*(?!\*)/g, + endUnd: /_(?!_)/g + }, link: edit(/^!?\[(label)\]\((.*?)\)/) .replace('label', inline._label) .getRegex(), diff --git a/test/specs/commonmark/commonmark.0.29.json b/test/specs/commonmark/commonmark.0.29.json index ae9be80c4e..fb5ef5805a 100644 --- a/test/specs/commonmark/commonmark.0.29.json +++ b/test/specs/commonmark/commonmark.0.29.json @@ -2763,8 +2763,7 @@ "example": 341, "start_line": 6003, "end_line": 6007, - "section": "Code spans", - "shouldFail": true + "section": "Code spans" }, { "markdown": "[not a `link](/foo`)\n", @@ -2973,8 +2972,7 @@ "example": 367, "start_line": 6455, "end_line": 6459, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*(*foo*)*\n", @@ -2982,8 +2980,7 @@ "example": 368, "start_line": 6465, "end_line": 6469, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*foo*bar\n", @@ -3007,8 +3004,7 @@ "example": 371, "start_line": 6497, "end_line": 6501, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "_(_foo_)_\n", @@ -3016,8 +3012,7 @@ "example": 372, "start_line": 6506, "end_line": 6510, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "_foo_bar\n", @@ -3073,8 +3068,7 @@ "example": 379, "start_line": 6570, "end_line": 6574, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "foo**bar**\n", @@ -3164,8 +3158,7 @@ "example": 390, "start_line": 6672, "end_line": 6676, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "**(**foo)\n", @@ -3173,8 +3166,7 @@ "example": 391, "start_line": 6685, "end_line": 6689, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*(**foo**)*\n", @@ -3222,8 +3214,7 @@ "example": 397, "start_line": 6742, "end_line": 6746, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "_(__foo__)_\n", @@ -3239,8 +3230,7 @@ "example": 399, "start_line": 6761, "end_line": 6765, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__пристаням__стремятся\n", @@ -3248,8 +3238,7 @@ "example": 400, "start_line": 6768, "end_line": 6772, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__foo__bar__baz__\n", @@ -3257,8 +3246,7 @@ "example": 401, "start_line": 6775, "end_line": 6779, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__(bar)__.\n", @@ -3298,8 +3286,7 @@ "example": 406, "start_line": 6824, "end_line": 6828, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__foo_ bar_\n", @@ -3391,8 +3378,7 @@ "example": 417, "start_line": 6928, "end_line": 6932, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*foo [*bar*](/url)*\n", @@ -3506,8 +3492,7 @@ "example": 431, "start_line": 7041, "end_line": 7047, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "**foo [*bar*](/url)**\n", @@ -3587,8 +3572,7 @@ "example": 441, "start_line": 7122, "end_line": 7126, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**\n", @@ -3605,8 +3589,7 @@ "example": 443, "start_line": 7136, "end_line": 7140, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "****foo*\n", @@ -3614,8 +3597,7 @@ "example": 444, "start_line": 7143, "end_line": 7147, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "**foo***\n", @@ -3843,8 +3825,7 @@ "example": 471, "start_line": 7355, "end_line": 7359, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*[bar*](/url)\n", @@ -3876,8 +3857,7 @@ "example": 475, "start_line": 7385, "end_line": 7389, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__\n", @@ -3885,8 +3865,7 @@ "example": 476, "start_line": 7392, "end_line": 7396, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*a `*`*\n", @@ -3910,8 +3889,7 @@ "example": 479, "start_line": 7413, "end_line": 7417, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__a\n", @@ -3919,8 +3897,7 @@ "example": 480, "start_line": 7420, "end_line": 7424, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "[link](/uri \"title\")\n", diff --git a/test/specs/gfm/commonmark.0.29.json b/test/specs/gfm/commonmark.0.29.json index ee732f38e3..0074ed958c 100644 --- a/test/specs/gfm/commonmark.0.29.json +++ b/test/specs/gfm/commonmark.0.29.json @@ -2763,8 +2763,7 @@ "example": 341, "start_line": 6003, "end_line": 6007, - "section": "Code spans", - "shouldFail": true + "section": "Code spans" }, { "markdown": "[not a `link](/foo`)\n", @@ -2973,8 +2972,7 @@ "example": 367, "start_line": 6455, "end_line": 6459, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*(*foo*)*\n", @@ -2982,8 +2980,7 @@ "example": 368, "start_line": 6465, "end_line": 6469, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*foo*bar\n", @@ -3007,8 +3004,7 @@ "example": 371, "start_line": 6497, "end_line": 6501, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "_(_foo_)_\n", @@ -3016,8 +3012,7 @@ "example": 372, "start_line": 6506, "end_line": 6510, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "_foo_bar\n", @@ -3073,8 +3068,7 @@ "example": 379, "start_line": 6570, "end_line": 6574, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "foo**bar**\n", @@ -3164,8 +3158,7 @@ "example": 390, "start_line": 6672, "end_line": 6676, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "**(**foo)\n", @@ -3173,8 +3166,7 @@ "example": 391, "start_line": 6685, "end_line": 6689, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*(**foo**)*\n", @@ -3222,8 +3214,7 @@ "example": 397, "start_line": 6742, "end_line": 6746, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "_(__foo__)_\n", @@ -3239,8 +3230,7 @@ "example": 399, "start_line": 6761, "end_line": 6765, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__пристаням__стремятся\n", @@ -3248,8 +3238,7 @@ "example": 400, "start_line": 6768, "end_line": 6772, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__foo__bar__baz__\n", @@ -3257,8 +3246,7 @@ "example": 401, "start_line": 6775, "end_line": 6779, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__(bar)__.\n", @@ -3298,8 +3286,7 @@ "example": 406, "start_line": 6824, "end_line": 6828, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__foo_ bar_\n", @@ -3391,8 +3378,7 @@ "example": 417, "start_line": 6928, "end_line": 6932, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*foo [*bar*](/url)*\n", @@ -3506,8 +3492,7 @@ "example": 431, "start_line": 7041, "end_line": 7047, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "**foo [*bar*](/url)**\n", @@ -3587,8 +3572,7 @@ "example": 441, "start_line": 7122, "end_line": 7126, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**\n", @@ -3605,8 +3589,7 @@ "example": 443, "start_line": 7136, "end_line": 7140, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "****foo*\n", @@ -3614,8 +3597,7 @@ "example": 444, "start_line": 7143, "end_line": 7147, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "**foo***\n", @@ -3843,8 +3825,7 @@ "example": 471, "start_line": 7355, "end_line": 7359, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*[bar*](/url)\n", @@ -3876,8 +3857,7 @@ "example": 475, "start_line": 7385, "end_line": 7389, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__\n", @@ -3885,8 +3865,7 @@ "example": 476, "start_line": 7392, "end_line": 7396, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "*a `*`*\n", @@ -3910,8 +3889,7 @@ "example": 479, "start_line": 7413, "end_line": 7417, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "__a\n", @@ -3919,8 +3897,7 @@ "example": 480, "start_line": 7420, "end_line": 7424, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "[link](/uri \"title\")\n", diff --git a/test/specs/new/em_2char.html b/test/specs/new/em_2char.html index eb49036249..9ffe69be1c 100644 --- a/test/specs/new/em_2char.html +++ b/test/specs/new/em_2char.html @@ -20,10 +20,6 @@

_ 123_

-

1_

- -

1*

-

It’s leviOHsa, not levioSAH.

-

__ test test

\ No newline at end of file +

__ test test

diff --git a/test/specs/new/em_2char.md b/test/specs/new/em_2char.md index da34739179..a1f5cf18b6 100644 --- a/test/specs/new/em_2char.md +++ b/test/specs/new/em_2char.md @@ -20,10 +20,6 @@ _123 _ _ 123_ -_1__ - -*1** - It’s levi*OH*sa, not levio*SAH.* __ test [test](https://test.com/_) diff --git a/test/specs/new/em_and_reflinks.html b/test/specs/new/em_and_reflinks.html new file mode 100644 index 0000000000..32eb3d41aa --- /dev/null +++ b/test/specs/new/em_and_reflinks.html @@ -0,0 +1,5 @@ +

Helloreflink*topguys!

+

Hello [notreflink] guys*!

+

Hello [notareflink] guys!

+

Helloreflink*bottomguys!

+

Helloreflinknoemguys!

diff --git a/test/specs/new/em_and_reflinks.md b/test/specs/new/em_and_reflinks.md new file mode 100644 index 0000000000..09c9b66bb3 --- /dev/null +++ b/test/specs/new/em_and_reflinks.md @@ -0,0 +1,15 @@ +[reflink*top]: theaddress + +*Hello [reflink*top] guys*! + +*Hello [not*reflink] guys*! + +*Hello [not*a*reflink] guys*! + +*Hello [reflink*bottom] guys*! + +*Hello [reflinknoem] guys*! + +[reflink*bottom]: theaddress + +[reflinknoem]: theaddress