You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/10/07 17:54:02 UTC

[GitHub] [airflow] ZxMYS commented on a change in pull request #6265: [AIRFLOW-5597] Linkify urls in task instance log

ZxMYS commented on a change in pull request #6265: [AIRFLOW-5597] Linkify urls in task instance log
URL: https://github.com/apache/airflow/pull/6265#discussion_r332154727
 
 

 ##########
 File path: airflow/www/templates/airflow/ti_log.html
 ##########
 @@ -121,10 +121,18 @@ <h4>{{ title }}</h4>
           if (res.message) {
             // Auto scroll window to the end if current window location is near the end.
             if(auto_tailing && checkAutoTailingCondition()) {
-              var should_scroll = true
+              var should_scroll = true;
             }
             // The message may contain HTML, so either have to escape it or write it as text.
-            document.getElementById(`try-${try_number}`).textContent += res.message + "\n";
+            var escaped_message = $("<div/>").text(res.message).html();
+
+            // Detect urls
+            var url_regex = /(https?:\/\/[^\s<>"]+)/g;
 
 Review comment:
   This regex doesn't work when there's a anchor tag (#). I switched to another more restrict regex - https://www.regexpal.com/?fam=111806

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services