Skip to content

Commit 8f8e3c0

Browse files
committed
fix:
1 parent 60575ca commit 8f8e3c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/utils/readme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ export async function renderReadmeHtml(
480480
const htmlHeadingRe = /<h([1-6])(\s[^>]*)?>([\s\S]*?)<\/h\1>/gi
481481
const htmlAnchorRe = /<a(\s[^>]*?)href=(["'])([^"']*)\2([^>]*)>([\s\S]*?)<\/a>/gi
482482
renderer.html = function ({ text }: Tokens.HTML) {
483-
let result = text.replace(htmlHeadingRe, (_, level, attrs, inner) => {
483+
let result = text.replace(htmlHeadingRe, (_, level, attrs = '', inner) => {
484484
const depth = parseInt(level)
485485
const plainText = decodeHtmlEntities(stripHtmlTags(inner).trim())
486486
const align = /\balign=(["'])(.*?)\1/i.exec(attrs)?.[2]

0 commit comments

Comments
 (0)