From fb641b09cebf29872a82d6034769c07efb46faa9 Mon Sep 17 00:00:00 2001 From: Frode Petterson <frode.andre.petterson@gmail.com> Date: Tue, 20 Jul 2021 09:59:59 +0200 Subject: [PATCH] Add back code highlighter fix that got replaced --- ckeditor/plugins/customCodeHighlighter/plugin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ckeditor/plugins/customCodeHighlighter/plugin.js b/ckeditor/plugins/customCodeHighlighter/plugin.js index 2f191ee5..45533547 100644 --- a/ckeditor/plugins/customCodeHighlighter/plugin.js +++ b/ckeditor/plugins/customCodeHighlighter/plugin.js @@ -35,7 +35,11 @@ CKEDITOR.plugins.add('customCodeHighlighter', { }, highlighter: function (code, language, callback) { // Here we are highlighting the code and returning it. - callback(code); + /** + * Note: Since we're not adding any highlighting we have to + * encode the html so that the html is not being run. + */ + callback(CKEDITOR.tools.htmlEncode(code)); } }); editor.plugins.codesnippet.setHighlighter(highlighter); -- GitLab