RESOLVED FIXED 227549
[results.webkit.org] linkify urls in commit messages
https://bugs.webkit.org/show_bug.cgi?id=227549
Summary [results.webkit.org] linkify urls in commit messages
Kevin Neal
Reported 2021-06-30 15:28:53 PDT
Commit messages usually contain URLs pointing to the bug; however, the URLs do not have hyperlinks to the bug.
Attachments
Patch (2.04 KB, patch)
2021-06-30 16:02 PDT, Kevin Neal
no flags
Patch (2.15 KB, patch)
2021-07-09 10:07 PDT, Kevin Neal
no flags
Patch (3.04 KB, patch)
2021-07-12 15:53 PDT, Kevin Neal
no flags
Patch (3.73 KB, patch)
2021-07-13 09:24 PDT, Kevin Neal
no flags
fast-cq Patch (3.32 KB, patch)
2021-07-13 09:32 PDT, Kevin Neal
no flags
Radar WebKit Bug Importer
Comment 1 2021-06-30 15:30:36 PDT
Kevin Neal
Comment 2 2021-06-30 16:02:46 PDT
Kevin Neal
Comment 3 2021-07-09 10:07:20 PDT
Zhifei Fang
Comment 4 2021-07-09 11:32:48 PDT
Comment on attachment 433222 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433222&action=review > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/commit.js:122 > + let linkify = (function(commitMessage) { better to make this a top level function, not a IIFE. If you put the code here, actually there is no need for have a IIFE. Originally line 117 we used the IIFE for making javascript string template can support normal js statements not just expressions. > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/commit.js:123 > + let reg = /\b(https?|rdar):\/{2}[^\s<>&]+/gmi; May also need to consider http, and I am not sure if we have some links without leading protocol, may worth to find if they are existed. > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/commit.js:125 > + let newMessageText = messageText.replace(reg, `<a href="$&">$&</a>`); It will be better to open a new tab, add target="_blank"
Jonathan Bedard
Comment 5 2021-07-12 08:42:30 PDT
Comment on attachment 433222 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433222&action=review >> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/commit.js:123 >> + let reg = /\b(https?|rdar):\/{2}[^\s<>&]+/gmi; > > May also need to consider http, and I am not sure if we have some links without leading protocol, may worth to find if they are existed. Existing code does consider http, I think, the regex is `https?` which should match http and https
Kevin Neal
Comment 6 2021-07-12 15:53:06 PDT
Jonathan Bedard
Comment 7 2021-07-12 16:02:45 PDT
Comment on attachment 433366 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433366&action=review > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/commit.js:121 > return `<br><div>${escapeHTML(cell.commit.message.split('\n')[0])}</div>`; We should lankily this text as well, in case someone has a link in the first line > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/commit.js:122 > + return linkify(escapeHTML(cell.commit.message)); We still want to keep the `<br><div></div>` surrounding this text
Kevin Neal
Comment 8 2021-07-13 09:24:30 PDT
Kevin Neal
Comment 9 2021-07-13 09:32:23 PDT
Created attachment 433410 [details] fast-cq Patch
EWS
Comment 10 2021-07-13 10:05:48 PDT
Committed r279876 (239629@main): <https://commits.webkit.org/239629@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433410 [details].
Note You need to log in before you can comment on or make changes to this bug.