From 4bb2925fbf5ad288a26b3fa65556b61d2dfb0fa6 Mon Sep 17 00:00:00 2001 From: ksen0 Date: Tue, 23 Sep 2025 18:55:37 +0200 Subject: [PATCH] Global flag and escape char fixes in regular expression --- docs/yuidoc-p5-theme/assets/js/reference.js | 4 ++-- src/typography/p5.Font.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/yuidoc-p5-theme/assets/js/reference.js b/docs/yuidoc-p5-theme/assets/js/reference.js index bfcfe7c281..1030c19903 100644 --- a/docs/yuidoc-p5-theme/assets/js/reference.js +++ b/docs/yuidoc-p5-theme/assets/js/reference.js @@ -2349,7 +2349,7 @@ define('listView',[ var hash = App.router.getHash(item); // fixes broken links for #/p5/> and #/p5/>= - item.hash = item.hash.replace('>', '>'); + item.hash = item.hash.replace(/>/g, '>'); // Create a group list if (!self.groups[group]) { @@ -3395,7 +3395,7 @@ var prettyPrint; // only when not following [|&;<>]. '^.[^\\s\\w.$@\'"`/\\\\]*'; if (options['regexLiterals']) { - punctuation += '(?!\s*\/)'; + punctuation += '(?!\\s*\/)'; } fallthroughStylePatterns.push( diff --git a/src/typography/p5.Font.js b/src/typography/p5.Font.js index 5a555120a0..b4a7269003 100644 --- a/src/typography/p5.Font.js +++ b/src/typography/p5.Font.js @@ -362,7 +362,7 @@ p5.Font = class { x = xOriginal; let line = lines[i]; - line = line.replace('\t', ' '); + line = line.replace(/\t/g, ' '); const glyphs = this._getGlyphs(line); for (let j = 0; j < glyphs.length; j++) {