Advertisement
Guest User

Untitled

a guest
Aug 11th, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       }, {
  2.         key: "fixHTMLHelper",
  3.         value: function fixHTMLHelper(str) {
  4.           str = str.replace(/<a href="https?:\/\/[^>]+>https?:\/\/[^<]+<\/a>[^<$\s\n]+/ig, function (match) {
  5.             try {
  6.               match = match.replace(/<\/a>/ig, "") + "</a>"
  7.               var newUrl = '"' + match.match( /(?:>)https?:\/\/[^<]+/ig )[ 0 ].substring(1);
  8.               match = match.replace( /"https?:\/\/[^"]+/ig, newUrl );
  9.             } catch (err) {}
  10.  
  11.             return match;
  12.           });
  13.           return str;
  14.         }
  15.       }, {
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement