From cf4b20dcddaca71677272d37a814098dab04223d Mon Sep 17 00:00:00 2001 From: Shivam7-1 <55046031+Shivam7-1@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:13:17 +0530 Subject: [PATCH] Added proper Input Handling --- docs/manual/style/scripts/prettify.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/manual/style/scripts/prettify.js b/docs/manual/style/scripts/prettify.js index 5d3a052964d..3d1c515b6d8 100644 --- a/docs/manual/style/scripts/prettify.js +++ b/docs/manual/style/scripts/prettify.js @@ -889,13 +889,11 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ } if (options['strings']) { - var strings = ("" + options['strings']).replace(/^ | $/g, '').replace(/-/g, '\\-'); - fallthroughStylePatterns.push( - [PR_STRING, - new RegExp('(?:' + strings.replace(/[\s,]+/g, '|') + ')'), - , null] - ); - } + var strings = ("" + options['strings']).replace(/^ | $/g, '').replace(/\\/g, '\\\\').replace(/-/g, '\\-'); + fallthroughStylePatterns.push( + [PR_STRING,new RegExp('(?:' + strings.replace(/[\s,]+/g, '|') + ')'),null] + ); + } var keywords = ("" + options['keywords']).replace(/^ | $/g, ''); if (keywords.length) {