Skip to content

Commit

Permalink
fixed the Bitrix script
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Mar 24, 2017
1 parent 55006bc commit 586f75c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion doc/scripting/note-from-bitrix-task.qml
Expand Up @@ -33,7 +33,7 @@ QtObject {

// https://regex101.com is your friend
// var headlineRegExp = /<span class="pagetitle-inner".*?>(.+?)<\/span>/im;
var headlineRegExp = /<span id="pagetitle".*?>(.+?)<\/span>/im;
var headlineRegExp = /<span id="pagetitle".*?>(.+?)<\/?span/im;
var headlineMatch = headlineRegExp.exec(html);
var headline = headlineMatch !== null ? headlineMatch[1] : "";
// remove the "aufgabe" text and all "/"
Expand Down Expand Up @@ -67,7 +67,16 @@ QtObject {
var urlMatch = urlRegExp.exec(html);
var url = urlMatch !== null ? urlMatch[1] : "";

// fallback url parsing
if (url == "") {
var urlRegExp = /<\/span><a href="(.+?)[\?#].*?" class="task-view-button edit.*?"/im;
var urlMatch = urlRegExp.exec(html);
var url = urlMatch !== null ? urlMatch[1] : "";
}

// script.log("headline");
// script.log(headline);
// script.log(url);
// script.log(descriptionMatch);
// script.log(description);
// script.log(url);
Expand Down

0 comments on commit 586f75c

Please sign in to comment.