improved on task id detection

This commit is contained in:
Patrizio Bekerle 2018-07-26 07:26:51 +02:00
parent c212b89eb7
commit 8796d9b2f6
No known key found for this signature in database
GPG Key ID: 2E9FFD770DABE838
2 changed files with 8 additions and 1 deletions

View File

@ -3,7 +3,7 @@
"identifier": "note-from-bitrix-task",
"script": "note-from-bitrix-task.qml",
"authors": ["@pbek"],
"version": "0.0.2",
"version": "1.0.3",
"minAppVersion": "17.05.6",
"description" : "This script creates a menu item and a button that parses the text that was copied from a task webpage of the webservice <a href='https://www.bitrix24.com/'>Bitrix24</a> and creates a new note with a headline, the link to the task and the description."
}

View File

@ -49,6 +49,13 @@ QtObject {
var taskIdMatch = taskIdRegExp.exec(html);
if (taskIdMatch !== null) {
headline += " (#" + taskIdMatch[1] + ")";
} else {
// do an other attempt to add the task id to the headline
taskIdRegExp = />(Task|Aufgabe) #(\d+) -</im;
taskIdMatch = taskIdRegExp.exec(html);
if (taskIdMatch !== null) {
headline += " (#" + taskIdMatch[2] + ")";
}
}
var descriptionRegExp = /<div.*? id="task-detail-description".*?>(.+?)<\/div>/im;