mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
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:
parent
5fae14fa74
commit
b1ae1dbcdd
@ -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 = '';
|
||||
|
Loading…
Reference in New Issue
Block a user