1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-12-21 15:38:09 +00:00

did some character escaping

This commit is contained in:
Patrizio Bekerle 2018-04-26 07:59:21 +02:00
parent 69a5d75874
commit ac5a0dc485
No known key found for this signature in database
GPG key ID: 2E9FFD770DABE838
2 changed files with 4 additions and 1 deletions

View file

@ -3,7 +3,7 @@
"identifier": "selected-markdown-to-jira",
"script": "selected-markdown-to-jira.qml",
"authors": ["@pbek"],
"version": "0.0.5",
"version": "1.0.0",
"minAppVersion": "17.05.7",
"description" : "With this script you can right click the selected text and convert it to <a href='https://www.atlassian.com/software/jira'>Jira</a> Code in the clipboard.\n\n<b>Dependencies</b>\n<a href=\"https://nodejs.org/en/download/\">Node.js</a>\n<a href=\"https://github.com/kylefarris/J2M\">jira2md</a> (installed via <code>npm</code>)\n\n<b>Installation</b>\nAfter you have installed <i>Node.js</i> you can install <i>jira2md</i> by typing:\n<code>sudo npm install -g jira2md</code>\n\nYou might also need to set your <code>NODE_PATH</code> to the path where the module did get installed with for example:\n<code>export NODE_PATH=/usr/local/lib/node_modules</code>"
}

View file

@ -50,6 +50,9 @@ QtObject {
text = text.replace(/^-/gm, "*");
text = text.replace(/\t-/gm, "\t*");
// some character escaping
text = text.replace(/\{/gm, "\\{").replace(/\}/gm, "\\}");
// you need NodeJs and jira2md (https://github.com/kylefarris/J2M) to convert Markdown to Jira
var params = ["-e", "console.log(require('jira2md').to_jira(require('fs').readFileSync('/dev/stdin').toString()))"];
var result = script.startSynchronousProcess(nodejsExecutablePath, params, text);