mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-11-14 05:48:08 +00:00
improved on task id detection
This commit is contained in:
parent
c212b89eb7
commit
8796d9b2f6
2 changed files with 8 additions and 1 deletions
|
@ -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."
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue