Disable fuzzy auto-linking of URLs in markdown preview (#884)

refs 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
This commit is contained in:
Kevin Ansfield 2017-10-03 11:14:40 +01:00 committed by Katharina Irrgang
parent 5fae14fa74
commit b1ae1dbcdd

View File

@ -40,7 +40,6 @@ let markdownitNamedHeaders = function markdownitNamedHeaders(md) {
};
};
// eslint-disable-next-line new-cap
let md = markdownit({
html: true,
breaks: true,
@ -51,6 +50,11 @@ let md = markdownit({
.use(markdownitMark)
.use(markdownitNamedHeaders);
// configure linkify-it
md.linkify.set({
fuzzyLink: false
});
export default function formatMarkdown(_markdown, replaceJS = true) {
let markdown = _markdown || '';
let escapedhtml = '';