Skip to content

Commit

Permalink
Autolinker: Silently catch any error thrown by decodeURIComponent. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Sep 13, 2017
1 parent 43fcb68 commit 2e43fcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion plugins/autolinker/prism-autolinker.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ Prism.hooks.add('wrap', function(env) {

env.attributes.href = href;
}
env.content = decodeURIComponent(env.content);

// Silently catch any error thrown by decodeURIComponent (#1186)
try {
env.content = decodeURIComponent(env.content);
} catch(e) {}
});

})();
2 changes: 1 addition & 1 deletion plugins/autolinker/prism-autolinker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2e43fcf

Please sign in to comment.