Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kiennt2/c9a489369562c424c793b8883b98802e to your computer and use it in GitHub Desktop.
Save kiennt2/c9a489369562c424c793b8883b98802e to your computer and use it in GitHub Desktop.
Convert URL Text Into Clickable HTML Link Using JavaScript
@birla
Copy link

birla commented Sep 9, 2021

Saved me a bunch of time! I added some look behind to make sure I wasn't converting links which were already in an anchor tag,

@umer93379
Copy link

umer93379 commented Feb 28, 2022

What if need to remove these parentheses(curve brackets) '(' and ')' from inputext ?

Can add following at the top but what could be the possibility if needed in existing lines ?

    var replacePattern4 = /[()]/g;
    replacedText = inputText.replace(replacePattern4, '');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment