Skip to content

Commit

Permalink
Fix double HTML-encoding bug in Groovy language
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitgeist87 committed Feb 19, 2016
1 parent 54400fb commit 24a0936
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions components/prism-groovy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Prism.hooks.add('wrap', function(env) {
if (delimiter === '$') {
pattern = /([^\$])(\$(\{.*?\}|[\w\.]+))/;
}

// To prevent double HTML-ecoding we have to decode env.content first
env.content = env.content.replace(/&amp;/g, '&').replace(/&lt;/g, '<');

env.content = Prism.highlight(env.content, {
'expression': {
pattern: pattern,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-groovy.min.js

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

0 comments on commit 24a0936

Please sign in to comment.