Skip to content

Commit 2e43fcf

Browse files
committed
Autolinker: Silently catch any error thrown by decodeURIComponent. Fixes #1186
1 parent 43fcb68 commit 2e43fcf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

plugins/autolinker/prism-autolinker.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ Prism.hooks.add('wrap', function(env) {
7171

7272
env.attributes.href = href;
7373
}
74-
env.content = decodeURIComponent(env.content);
74+
75+
// Silently catch any error thrown by decodeURIComponent (#1186)
76+
try {
77+
env.content = decodeURIComponent(env.content);
78+
} catch(e) {}
7579
});
7680

7781
})();

plugins/autolinker/prism-autolinker.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)