Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~';
inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();

// sequences em should skip over [title](link), `code`, <html>
inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
inline.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;
// lookbehind is not available on Safari as of version 16
// inline.escapedEmSt = /(?<=(?:^|[^\\)(?:\\[^])*)\\[*_]/g;
inline.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
Expand Down
5 changes: 3 additions & 2 deletions test/helpers/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ export function loadFiles(dir) {
return obj;
}

for (const spec of specs) {
for (let i = 0; i < specs.length; i++) {
const spec = specs[i];
if (!spec.section) {
spec.section = name;
spec.section = `${name}[${i}]`;
}
if (!obj[spec.section]) {
obj[spec.section] = {
Expand Down
18 changes: 18 additions & 0 deletions test/specs/redos/quadratic_em_mask.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = [
{
markdown: '['.repeat(100000),
html: `<p>${'['.repeat(100000)}</p>`
},
{
markdown: '[.'.repeat(50000),
html: `<p>${'[.'.repeat(50000)}</p>`
},
{
markdown: '<'.repeat(100000),
html: `<p>${'<'.repeat(100000)}</p>`
},
{
markdown: '<.'.repeat(50000),
html: `<p>${'<.'.repeat(50000)}</p>`
}
];