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) {