fix: update doc-content.vue renderer to marked v5+ token API
This commit is contained in:
@@ -172,7 +172,7 @@ const checkImage = (url) => {
|
|||||||
img.src = url;
|
img.src = url;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
renderer.image = function (href: string, title: string | null, text: string) {
|
renderer.image = function ({href, title, text}) {
|
||||||
if (!isValidImageURL(href)) {
|
if (!isValidImageURL(href)) {
|
||||||
return `<p>${t('error.invalidImageLink')}</p>`;
|
return `<p>${t('error.invalidImageLink')}</p>`;
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ renderer.image = function (href: string, title: string | null, text: string) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 自定义代码块渲染器,只显示语言标签
|
// 自定义代码块渲染器,只显示语言标签
|
||||||
renderer.code = function (text: string, lang?: string) {
|
renderer.code = function ({text, lang}) {
|
||||||
// Mermaid 图表处理
|
// Mermaid 图表处理
|
||||||
if (lang === 'mermaid') {
|
if (lang === 'mermaid') {
|
||||||
// 生成唯一ID
|
// 生成唯一ID
|
||||||
|
|||||||
Reference in New Issue
Block a user