From cc675429b8137fcbdce11bf422aaf8720c496780 Mon Sep 17 00:00:00 2001 From: Ming Di Leom <2809763-curben@users.noreply.gitlab.com> Date: Thu, 16 Jan 2025 10:21:50 +0000 Subject: [PATCH] fix(heading-link): compatibility with marked v15 https://github.com/hexojs/hexo-renderer-marked/pull/305 --- scripts/image.js | 2 +- themes/chameleon/scripts/heading-link.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/image.js b/scripts/image.js index 8e220a8..8d4147b 100644 --- a/scripts/image.js +++ b/scripts/image.js @@ -11,7 +11,7 @@ const { join } = require('path').posix hexo.extend.filter.register('marked:renderer', (renderer) => { - renderer.image = (href, title, alt) => { + renderer.image = ({ href, title, text: alt }) => { if (!alt) alt = '' if (!title) title = alt diff --git a/themes/chameleon/scripts/heading-link.js b/themes/chameleon/scripts/heading-link.js index 96f2470..6feab1f 100644 --- a/themes/chameleon/scripts/heading-link.js +++ b/themes/chameleon/scripts/heading-link.js @@ -15,7 +15,7 @@ const anchorId = (str, transformOption) => { hexo.extend.filter.register('marked:renderer', function (renderer) { const { config } = this const headingId = {} - renderer.heading = function (text, level) { + renderer.heading = function ({ text, depth: level }) { const { modifyAnchors } = config.marked const transformOption = modifyAnchors let id = anchorId(text, transformOption)