Compare commits

...

1 Commits

  1. 6
      src/utils.ts

6
src/utils.ts

@ -144,6 +144,8 @@ export function wsJsonToRes(msg: WebSocketJsonResponse): WebSocketResponse {
};
}
export const emojiDefs = {...objectFlip(emojiShortName), ...emojiReplacements};
export const md = new markdown_it({
html: false,
linkify: true,
@ -167,7 +169,7 @@ export const md = new markdown_it({
},
})
.use(markdownitEmoji, {
defs: objectFlip(emojiShortName),
defs: emojiDefs,
})
.use(iterator, 'url_new_win', 'link_open', function (tokens, idx) {
// in markdown, if a link tag is missing a protocol, add it
@ -222,7 +224,7 @@ export function hotRank(score: number, timeStr: string): number {
}
export function mdToHtml(text = ''): { __html: string } {
return { __html: replaceEmojis(md.render(text || '')) };
return { __html: md.render(text || '') };
}
export function getUnixTime(text: string): number {

Loading…
Cancel
Save