mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: allow better fidelity for auto linkify, disable most tlds based linkify
New site settings: enable_markdown_linkify: which is default on, auto links https:// and http:// and mail:// markdown_linkify_tlds: which allows control of what tlds get autolinked for cases such as www.site.com, default is com|net|gov
This commit is contained in:
@@ -27,7 +27,8 @@ describe "CommonMark" do
|
||||
html.gsub!('<hr />', '<hr>')
|
||||
html.gsub!(/<img([^>]+) \/>/, "<img\\1>")
|
||||
|
||||
cooked = PrettyText.markdown(md, sanitize: false, linkify: false)
|
||||
SiteSetting.enable_markdown_linkify = false
|
||||
cooked = PrettyText.markdown(md, sanitize: false)
|
||||
cooked.strip!
|
||||
cooked.gsub!(" class=\"lang-auto\"", '')
|
||||
cooked.gsub!(/<span class="hashtag">(.*)<\/span>/, "\\1")
|
||||
|
||||
Reference in New Issue
Block a user