From b82932b49234bceadfddae92aba86a055c6a6c07 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 3 Oct 2017 11:14:53 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=20Disabled=20auto-linking=20of?= =?UTF-8?q?=20domain=20names=20in=20markdown=20(#9084)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/issues/8987 - set `linkify-it` `fuzzyLink` option to false so that it only auto-links URLs starting with `http(s)://` or other valid schemes --- core/server/utils/markdown-converter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/server/utils/markdown-converter.js b/core/server/utils/markdown-converter.js index c32fe656f9..bb330409ad 100644 --- a/core/server/utils/markdown-converter.js +++ b/core/server/utils/markdown-converter.js @@ -1,4 +1,4 @@ -var MarkdownIt = require('markdown-it'), +var MarkdownIt = require('markdown-it'), converter = new MarkdownIt({ html: true, breaks: true, @@ -44,6 +44,11 @@ var MarkdownIt = require('markdown-it'), // jscs:enable }); +// configure linkify-it +converter.linkify.set({ + fuzzyLink: false +}); + module.exports = { render: function (markdown) { return converter.render(markdown);