Idea: Option to always linkify untagged URLs in imported HTML

Hi there, I’m working on importing a huge Drupal forum into Discourse. Drupal and most other forum / CMS platforms too can automatically create an HTML link in a post by simply typing https://example.com , as does Discourse. But Discourse only does so when the post is using Markdown, not inside an HTML element (whether it’s an imported post or the user is pasting in HTML from somewhere else). In the case of imported HTML from another forum platform, there are often URLs that are not tagged as links in the raw post body, but the forum engine would detect the URL and linkify it anyway in the rendered post. But in Discourse the URL is the following HTML paragraph would not be a link:


<p>Take a look at http://example.com for that.</p>

Take a look at http://example.com for that.


I could do some regexp hackery in the importer script to detect raw URLs and turn them into a Markdown link, or I could even just replace occurrences of <p> with a new line and Discourse will render it fine. But that would be quite a messy solution and I don’t trust my regexp skills to not end up with a special case where it ends up inadvertently linking or deleting an entire post. A Discourse option to detect and linkify raw URLs inside HTML code would be appreciated.

Could setting enable rich text paste help?

Thanks for mentioning that option, that would work when pasting rendered HTML if the previous engine had already automatically linked the URL, but not for raw HTML code with an unlinked URL. Also that option wouldn’t affect imported posts from another forum engine.

I see. That sounds quite logical too,