Skip to content

Commit 27d2546

Browse files
committed
v11.14.0
1 parent 7c5d9b4 commit 27d2546

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/utils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ export async function markdownToHtml(s: string): Promise<string> {
77

88
renderer.heading = ({ tokens, depth }) => {
99
const text = renderer.parser.parseInline(tokens);
10-
if (depth === 1) return `<b>${text}</b>\n\n`;
11-
if (depth === 2) return `<b>${text}</b>\n\n`;
10+
if (depth === 1) {
11+
return `<b>${text}</b>\n\n`;
12+
}
13+
if (depth === 2) {
14+
return `<b>${text}</b>\n\n`;
15+
}
1216
return `<b>${text}</b>\n\n`;
1317
};
1418

@@ -59,7 +63,7 @@ export async function markdownToHtml(s: string): Promise<string> {
5963
'b', 'strong', 'i', 'em', 'u', 'ins', 's', 'strike', 'del',
6064
'span', 'tg-spoiler', 'a', 'code', 'pre', 'blockquote'
6165
];
62-
const match = /^<\/?([a-z0-9\-]+)(?:\s+[^>]*)?>/i.exec(text);
66+
const match = /^<\/?([a-z0-9-]+)(?:\s+[^>]*)?>/i.exec(text);
6367
if (match) {
6468
const tagName = match[1].toLowerCase();
6569
if (allowedTags.includes(tagName)) {

0 commit comments

Comments
 (0)