mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05: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
1 changed files with 5 additions and 1 deletions
|
@ -40,7 +40,6 @@ let markdownitNamedHeaders = function markdownitNamedHeaders(md) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line new-cap
|
|
||||||
let md = markdownit({
|
let md = markdownit({
|
||||||
html: true,
|
html: true,
|
||||||
breaks: true,
|
breaks: true,
|
||||||
|
@ -51,6 +50,11 @@ let md = markdownit({
|
||||||
.use(markdownitMark)
|
.use(markdownitMark)
|
||||||
.use(markdownitNamedHeaders);
|
.use(markdownitNamedHeaders);
|
||||||
|
|
||||||
|
// configure linkify-it
|
||||||
|
md.linkify.set({
|
||||||
|
fuzzyLink: false
|
||||||
|
});
|
||||||
|
|
||||||
export default function formatMarkdown(_markdown, replaceJS = true) {
|
export default function formatMarkdown(_markdown, replaceJS = true) {
|
||||||
let markdown = _markdown || '';
|
let markdown = _markdown || '';
|
||||||
let escapedhtml = '';
|
let escapedhtml = '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue