Refactor helpers.emphasisMarkersInContent slightly to avoid duplicate/unnecessary work.

This commit is contained in:
David Anson 2021-11-26 05:37:04 +00:00 committed by GitHub
parent 11806dc5cb
commit a508824b0f
3 changed files with 34 additions and 34 deletions

View file

@ -105,7 +105,7 @@ module.exports = {
let match = null;
// Match all emphasis-looking runs in the line...
while ((match = emphasisRe.exec(line))) {
const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex] || [];
const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex];
const matchIndex = match.index + match[1].length;
if (ignoreMarkersForLine.includes(matchIndex)) {
// Ignore emphasis markers inside code spans and links