mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-12-22 07:58:08 +00:00
Merge pull request #30 from nikhilw/master
Issue-27: BugFix: html entities breaking rendering in plantuml. BugFi…
This commit is contained in:
commit
0a949ae53e
1 changed files with 3 additions and 1 deletions
|
@ -66,6 +66,8 @@ QtObject {
|
||||||
var matchedUml = match[1].replace(/\n/gi, "\\n");
|
var matchedUml = match[1].replace(/\n/gi, "\\n");
|
||||||
var filePath = workDir + "/" + note.id + "_" + (++index);
|
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 params = ["-e", "require('fs').writeFileSync('" + filePath + "', \"" + matchedUml + "\", 'utf8');"];
|
||||||
var result = script.startSynchronousProcess("node", params, html);
|
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
|
* @return {string} the modfied html or an empty string if nothing should be modified
|
||||||
*/
|
*/
|
||||||
function noteToMarkdownHtmlHook(note, html) {
|
function noteToMarkdownHtmlHook(note, html) {
|
||||||
var plantumlSectionRegex = /<pre><code class=\"language-plantuml\"\>([\s\S]*?)<\/pre>/gmi;
|
var plantumlSectionRegex = /<pre><code class=\"language-plantuml\"\>([\s\S]*?)(<\/code>)?<\/pre>/gmi;
|
||||||
|
|
||||||
var plantumlFiles = extractPlantUmlText(html, plantumlSectionRegex, note);
|
var plantumlFiles = extractPlantUmlText(html, plantumlSectionRegex, note);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue