Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Autolink with markdown?
judgej
✭
I have markdown set as the default format for posts on my site. When a URL is added to a post, it does not get converted into a link. Is that expected for the markdown formatting?
Users get very confused with the markdown format for links and just want to post a URL (having to give it a label and special brackets is one step too far - people just want to throw stuff at the forum and not have to learn its intricacies for formatting).
So - are autolinks supported in Vanilla with markdown set as the default format? If not, does anyone have any hints on how to enable it or add it, perhaps something that can be made into a plugin?
Users get very confused with the markdown format for links and just want to post a URL (having to give it a label and special brackets is one step too far - people just want to throw stuff at the forum and not have to learn its intricacies for formatting).
So - are autolinks supported in Vanilla with markdown set as the default format? If not, does anyone have any hints on how to enable it or add it, perhaps something that can be made into a plugin?
0
Comments
The URLs that I convert are any that are not preceded by a ", <, [ or (, plus optional white space.
It works okay as a hack, but it would be nice to see a hook in place in the format class (library/core/class.format.php - which I have had to hack anyway to increase tge username length to 40 characters), so I could pre-process the comments and discussions text in a plugin.
First I added a function to do the pre-processing: Then right at the end of the Markdown() function, change the return value to this: I will probably add something for emails too, but that is not in there yet. I'm sure the regex could do with some refinement - the "&" in it does not look right, but the concept and so far in practice, it works at least. I got the regex from an RE site, and this one looked better than most, but I have not tested it thoroughly.
This converts URL into [URL](URL) which becomes a linked URL after it passes through the markdown filter. Being cleverer, the label part [in square brackets] could be shortened to just the domain and an abbreviation of the path.
In theory even <URL> should be a clickable link, but it does not seem to be working properly (it munges part of the URL) and even this is one step too far for most users to have to learn and get to grips with, even if it did work.