mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 01:36:08 +08:00
15 lines
326 B
TypeScript
15 lines
326 B
TypeScript
import 'hydrooj';
|
|
import TurndownService from 'turndown';
|
|
|
|
const turndownService = new TurndownService({
|
|
headingStyle: 'atx',
|
|
codeBlockStyle: 'fenced',
|
|
bulletListMarker: '-',
|
|
});
|
|
|
|
export function convertHTML(html: string) {
|
|
return turndownService.turndown(html);
|
|
}
|
|
|
|
global.Hydro.lib.convertHTML = convertHTML;
|