diff --git a/lib/md038.js b/lib/md038.js index 25314197..3019a600 100644 --- a/lib/md038.js +++ b/lib/md038.js @@ -19,7 +19,7 @@ module.exports = { inlineCodeSpansRe.lastIndex = 0; } const match = inlineCodeSpansRe.exec(parent.content); - const content = match[3]; + const content = (match || [])[3]; const leftError = /^\s([^`]|$)/.test(content); const rightError = /[^`]\s$/.test(content); if (leftError || rightError) { diff --git a/test/backslashes-and-backticks.md b/test/backslashes-and-backticks.md new file mode 100644 index 00000000..6a213d1a --- /dev/null +++ b/test/backslashes-and-backticks.md @@ -0,0 +1,4 @@ +# Heading + +\\`\\ +\\`\\