Hypercontext / linkifyjs

JavaScript plugin for finding links in plain-text and converting them to HTML <a> tags.
https://linkify.js.org
MIT License
1.84k stars 183 forks source link

Markdown formatted links in text #220

Open Kequc opened 6 years ago

Kequc commented 6 years ago

Linkifyjs shouldn't be a markdown parser.

But somehow or another Markdown formatted links keep showing up in strings that are submitted by users. Maybe this library can check for them?

Or how should I try and handle them myself?

Current:

[http://example.com](http://example.com)
"http://example.com](http://example.com)" is captured once.

Preferred:

"http://example.com" is captured twice.
nfrasser commented 6 years ago

There's no great way of going about this unfortunately. I'd suggest running Linkify after the markdown is rendered, with one of the DOM-compatible interfaces: http://soapbox.github.io/linkifyjs/docs/interfaces.html

Kequc commented 6 years ago

I'd really rather not render markdown, just capture the links without them breaking. The same thing could be done for square brackets as is being done with round ones?

I hate to put work on anyones plate, it does seem odd behaviour.