Skip to content

Commit

Permalink
Merge pull request #5960 from okurz/fix/anser
Browse files Browse the repository at this point in the history
Remove obsolete linkify workaround for anser<2.3
  • Loading branch information
mergify[bot] authored Sep 30, 2024
2 parents 04d6aad + c5ac716 commit aafbe7d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions assets/javascripts/anser-import.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
const module = {};

// https://github.com/IonicaBizau/anser/pull/75
// https://datatracker.ietf.org/doc/html/rfc3986#appendix-A
function linkify(txt) {
const re = /(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;
return txt.replace(re, function (str) {
return '<a href="' + str + '">' + str + '</a>';
});
}
function ansiToHtml(data) {
return linkify(Anser.ansiToHtml(Anser.escapeForHtml(data), {use_classes: true}));
return Anser.linkify(Anser.ansiToHtml(Anser.escapeForHtml(data), {use_classes: true}));
}
function ansiToText(data) {
return Anser.ansiToText(data);
Expand Down

0 comments on commit aafbe7d

Please sign in to comment.