Commit 31655066 authored by derek-knox's avatar derek-knox

Fix identifers validation against null next node

The previous solution didn't account for
when a current node's literal had a valid
value but the next node was in fact null
parent 8f65bfc8
...@@ -33,7 +33,7 @@ const hasExitingPotential = literal => literal.includes(']: '); ...@@ -33,7 +33,7 @@ const hasExitingPotential = literal => literal.includes(']: ');
const hasAdjacentExit = node => { const hasAdjacentExit = node => {
let currentNode = node; let currentNode = node;
while (currentNode.next && currentNode.literal !== null) { while (currentNode && currentNode.literal !== null) {
if (hasExitingPotential(currentNode.literal)) { if (hasExitingPotential(currentNode.literal)) {
return true; return true;
} }
......
---
title: Fix unique case where static site editor's custom renderer for identifier syntax didn't robustly handle inline code
merge_request: 35775
author: Derek Knox
type: fixed
...@@ -19,9 +19,7 @@ const buildMockTextNodeWithAdjacentInlineCode = isForward => { ...@@ -19,9 +19,7 @@ const buildMockTextNodeWithAdjacentInlineCode = isForward => {
type: 'code', type: 'code',
[direction]: { [direction]: {
literal: isForward ? literalClose : literalOpen, literal: isForward ? literalClose : literalOpen,
[direction]: { [direction]: null,
literal: null,
},
}, },
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment