(.+?)<\/a>/gim, "<$1>");
+
+ // transform html breaks to \n, into \n\n and remove all other tags
+ description = description.replace(//gim, "\n").replace(/<\/p>/gim, "\n\n").replace(/<.+?>/gim, "").trim();
+
+ // add the headline of the issue
+ var text = headline + "\n";
+
+ // add "=" characters so that the headline is really a headline
+ for (var i = 0; i < headline.length; i++) {
+ text += "=";
+ }
+
+ text += "\n\n";
+
+ // add the url to the issue
+ if (url != "") {
+ text += "- <" + url + ">\n\n";
+ }
+
+ // add the description of the issue
+ if (description != "") {
+ text += description + "\n\n";
+ }
+
+ text = text.replace(/>/gim, ">").replace(/</gim, "<");
+
+ // add a date headline
+ var m = new Date();
+ var dateString =
+ ("0" + m.getDate()).slice(-2) + "." +
+ ("0" + (m.getMonth()+1)).slice(-2) + "." +
+ m.getFullYear();
+ text += "\n\n## " + dateString + "\n\n";
+
+ // create a new note
+ script.createNote(text);
+
+ // tag the current note
+ script.tagCurrentNote("todo");
+
+ // workaround because the parsers don't seem to work every time
+// script.reloadScriptingEngine();
+ }
+}