Skip to content

Commit

Permalink
enable html rendering to enable comments
Browse files Browse the repository at this point in the history
  • Loading branch information
resucutie committed May 12, 2024
1 parent 1b0cd39 commit ac81344
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,21 @@ const ensureDistFolder = async () => {

const mdProcessor = (content, emojis) => {
let anchors = []
const md = markdownIt()
.use(mdAnchor, {
callback: (token, info) => {
if(!(token.tag === "h1" || token.tag === "h2")) return

anchors.push({
slug: info.slug,
title: info.title,
tag: token.tag
})
}
})
.use(mdEmojis.full, {defs: emojis})
.use(mdSmall)
const md = markdownIt({
html: true
})
.use(mdAnchor, {
callback: (token, info) => {
if(!(token.tag === "h1" || token.tag === "h2")) return
anchors.push({
slug: info.slug,
title: info.title,
tag: token.tag
})
}
})
.use(mdEmojis.full, {defs: emojis})
.use(mdSmall)

// add open in new tab functionality
const defaultRender = md.renderer.rules.link_open || function (tokens, idx, options, _env, self) {
Expand Down

0 comments on commit ac81344

Please sign in to comment.