diff --git a/extension/highlight-code.js b/extension/highlight-code.js index 650f258..5b85cf9 100644 --- a/extension/highlight-code.js +++ b/extension/highlight-code.js @@ -8,9 +8,10 @@ var loadLanguages = require('prismjs/components/'); function extHighlightCode(_a) { var selector = _a.selector; var updateJava = function (html, language) { - if (language === 'java' || language === 'kotlin' || language === 'typescript') { - console.log(html); - return html.replace(/&<\/span>lt;<\/span>/g, '<') + if (language === 'java' || language === 'kotlin' || language === 'typescript' || language === 'javascript') { + return html + .replace(/&<\/span>quot;<\/span>/g, '"') + .replace(/&<\/span>lt;<\/span>/g, '<') .replace(/&<\/span>gt;<\/span>/g, '>'); } return html; @@ -28,7 +29,6 @@ function extHighlightCode(_a) { var language = elem.prop('data-lang') || 'javascript'; var fileContents = elem.html(); loadLanguages(language); - console.log(fileContents, language); var highlightedContents = Prism.highlight(fileContents, Prism.languages[language], language); var finalHtml = updateJava(highlightedContents, language); elem.parent().replaceWith("
" + finalHtml + "
"); diff --git a/extension/highlight-code.ts b/extension/highlight-code.ts index 8be1828..62f6db2 100644 --- a/extension/highlight-code.ts +++ b/extension/highlight-code.ts @@ -11,8 +11,10 @@ const loadLanguages = require('prismjs/components/'); export function extHighlightCode({selector}): Transform { const updateJava = (html, language) => { - if (language === 'java' || language === 'kotlin' || language === 'typescript') { - return html.replace(/&<\/span>lt;<\/span>/g, '<') + if (language === 'java' || language === 'kotlin' || language === 'typescript' || language === 'javascript') { + return html + .replace(/&<\/span>quot;<\/span>/g, '"') + .replace(/&<\/span>lt;<\/span>/g, '<') .replace(/&<\/span>gt;<\/span>/g, '>') } return html; diff --git a/src/blog/2018/test2.adoc b/src/blog/2018/test2.adoc index 945b5b2..9ad349a 100644 --- a/src/blog/2018/test2.adoc +++ b/src/blog/2018/test2.adoc @@ -11,6 +11,7 @@ Test [source, java, subs="specialchars"] ---- +@RequestMapping("/api/hello") class CallForPaperServiceTests { /** * Java comment