fix(heading-link): compatibility with marked v15

https://github.com/hexojs/hexo-renderer-marked/pull/305
This commit is contained in:
Ming Di Leom 2025-01-16 10:21:50 +00:00
parent bd36476125
commit cc675429b8
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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)