From 423a4a521acf666d8b32ff8b8e779c68807df954 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 2 Aug 2024 15:25:41 -0500 Subject: [PATCH] Correct truncation when looking for data: in css folding --- shared/naturalcrit/codeEditor/codeEditor.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/shared/naturalcrit/codeEditor/codeEditor.jsx index a96feb723..9080379a1 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.jsx +++ b/shared/naturalcrit/codeEditor/codeEditor.jsx @@ -438,7 +438,7 @@ const CodeEditor = createClass({ // Extra data url chomping // Try to make it pretty... - const startOfData = text.indexOf('data:'); + const startOfData = text.indexOf('data:') > 0 ? text.indexOf('data:') : false; if(startOfData) { text = (startOfData > maxLength) ? `${text.slice(0, text.indexOf(':') + 1)} ... ${text.slice(startOfData, startOfData + 5)} ...` :