diff --git a/render-plantuml/render-plantuml.qml b/render-plantuml/render-plantuml.qml index 2a90675..a4eabaa 100644 --- a/render-plantuml/render-plantuml.qml +++ b/render-plantuml/render-plantuml.qml @@ -65,6 +65,8 @@ QtObject { while (match != null) { var matchedUml = match[1].replace(/\n/gi, "\\n"); var filePath = workDir + "/" + note.id + "_" + (++index); + + matchedUml = matchedUml.replace(/>/g, ">").replace(/</g, "<").replace(/"/g, "\\\"").replace(/"/g, "\\\"").replace(/&/g, "&"); var params = ["-e", "require('fs').writeFileSync('" + filePath + "', \"" + matchedUml + "\", 'utf8');"]; var result = script.startSynchronousProcess("node", params, html); @@ -108,7 +110,7 @@ QtObject { * @return {string} the modfied html or an empty string if nothing should be modified */ function noteToMarkdownHtmlHook(note, html) { - var plantumlSectionRegex = /
([\s\S]*?)<\/pre>/gmi;
+        var plantumlSectionRegex = /
([\s\S]*?)(<\/code>)?<\/pre>/gmi;
         
         var plantumlFiles = extractPlantUmlText(html, plantumlSectionRegex, note);