0

I am using an editor which doesn't allow links or code to be added. For example, I can add the following:

[url=http://example.com]This is a test[/url]

This will then show on the website exactly as it is shown above.

How can I then use Javascript to turn the above into a link, but only show This is a test but with a link on it?

RustyIngles
  • 2,433
  • 4
  • 27
  • 31
  • 5
    If your editor escapes the HTML so the code is actually rendered as text it does NOT allow HTML. – Jordi Nebot Jul 09 '19 at 08:58
  • 1
    See [my answer](https://stackoverflow.com/a/5158204/157247) to the linked question. All you need to do is come up with the regex for your `url` pattern, which is fairly simple: `/\[url\s*=\s*([^\]]+)\]([^[]+)\[\/url]/` :-) – T.J. Crowder Jul 09 '19 at 09:06

0 Answers0