You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/packages/html2md/lib.ts

21 lines
428 B
TypeScript

import 'hydrooj';
import TurndownService from 'turndown';
declare module 'hydrooj' {
interface Lib {
convertHTML: (str: string) => string,
}
}
4 years ago
const turndownService = new TurndownService({
headingStyle: 'atx',
codeBlockStyle: 'fenced',
bulletListMarker: '-',
});
export function convertHTML(html: string) {
return turndownService.turndown(html);
}
global.Hydro.lib.convertHTML = convertHTML;