feat: add some highlighting to markdown renderer
This commit is contained in:
@ -73,6 +73,12 @@ async function processCreateArticle(
|
||||
return `})`;
|
||||
}
|
||||
|
||||
if (!src.startsWith("https://") && !src.startsWith("http://")) {
|
||||
return `}/${
|
||||
src.replace(/^\//, "")
|
||||
})`;
|
||||
}
|
||||
|
||||
return ``;
|
||||
},
|
||||
});
|
||||
@ -87,9 +93,16 @@ async function processCreateArticle(
|
||||
}
|
||||
|
||||
if (href.startsWith("#")) {
|
||||
if (content.length < 2) return "";
|
||||
return `[${content}](${url.href}#${href})`.replace("##", "#");
|
||||
}
|
||||
|
||||
if (!href.startsWith("https://") && !href.startsWith("http://")) {
|
||||
return `[${content}](${url.origin.replace(/\/$/, "")}/${
|
||||
href.replace(/^\//, "")
|
||||
})`;
|
||||
}
|
||||
|
||||
return `[${content}](${href})`;
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user