Skip to content

Commit 24a0936

Browse files
committed
Fix double HTML-encoding bug in Groovy language
1 parent 54400fb commit 24a0936

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

components/prism-groovy.js

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Prism.hooks.add('wrap', function(env) {
3737
if (delimiter === '$') {
3838
pattern = /([^\$])(\$(\{.*?\}|[\w\.]+))/;
3939
}
40+
41+
// To prevent double HTML-ecoding we have to decode env.content first
42+
env.content = env.content.replace(/&amp;/g, '&').replace(/&lt;/g, '<');
43+
4044
env.content = Prism.highlight(env.content, {
4145
'expression': {
4246
pattern: pattern,

components/prism-groovy.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)