Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit 743332e

Browse files
fix bug: run_prettify ignored first query parameter
1 parent abdc45d commit 743332e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

js-modules/run_prettify.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@
134134
// If the script is loaded twice, then this will run in reverse order.
135135
for (var scripts = doc.scripts, i = scripts.length; --i >= 0;) {
136136
var script = scripts[i];
137-
var match = script.src.match(/\/run_prettify\.js(?:\?([^#]*))?(?:#.*)?$/);
137+
var match = script.src.match(
138+
/^[^?#]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);
138139
if (match) {
139140
scriptQuery = match[1] || '';
140141
// Remove the script from the DOM so that multiple runs at least run

src/run_prettify.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ var IN_GLOBAL_SCOPE = false;
138138
// If the script is loaded twice, then this will run in reverse order.
139139
for (var scripts = doc.scripts, i = scripts.length; --i >= 0;) {
140140
var script = scripts[i];
141-
var match = script.src.match(/\/run_prettify\.js(?:\?([^#]*))?(?:#.*)?$/);
141+
var match = script.src.match(
142+
/^[^?#]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);
142143
if (match) {
143144
scriptQuery = match[1] || '';
144145
// Remove the script from the DOM so that multiple runs at least run

0 commit comments

Comments
 (0)