Merge pull request #2871 from steve02081504/patch-4 fix `\x01` display in modern WI editor

6d731bbefe171fdb73264aae6c20cbffc83b214a

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +5 -5Ignore whitespace
public/scripts/utils.js+5 -5
@@ -1908,13 +1908,13 @@ export function select2ChoiceClickSubscribe(control, action, { buttonStyle = fal
19081908 * @returns {string} The html representation of the highlighted regex
19091909 */
19101910export function highlightRegex(regexStr) {
19111911 // Function to escape HTML special characters for safety or readability
19121912 const escapeHtmlescape = (str) => str.replace(/[&<>"'\x01]/g, match => ({
19131913 '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', '\'': '&#39;', '\x01': '\\x01',
19141914 })[match]);
19151915
19161916 // Replace special characters with their HTML-escaped forms
19171917 regexStr = escapeHtmlescape(regexStr);
19181918
19191919 // Patterns that we want to highlight only if they are not escaped
19201920 function getPatterns() {