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:
[email protected]


With regards,
Apache Git Services

Reply via email to