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 15:26:40 UTC

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

kaxil 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_r332084839
 
 

 ##########
 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:
   Will this cover all cases?
   
   How about the following from http://www.noah.org/wiki/RegEx_Python?
   
   ```
   http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+
   ```

----------------------------------------------------------------
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