rich-editor-to-markdown-parser
Version:
Rich Editor response convert to markdown.
36 lines (33 loc) • 676 B
TypeScript
type OptionTypes = {
image?: Partial<Image>;
/**
* Change markdown style.
*/
markStyle?: Partial<MarkStyle>;
};
type Image = {
/**
* Contain width and height image size
* ex) ?w=1200&h=630
*/
size: boolean;
/**
* Add image query in markdown.
* ex) ?format=webp
*/
query: string;
};
type MarkStyle = {
strong: "**" | "__";
em: "*" | "_";
li: "*" | "-" | "+";
hr: "---" | "***" | "___";
pre: "```" | "~~~";
};
/**
* @param html - HTML string.
* @param options - Options.
* @returns - String
*/
declare const parser: (html: string, options?: OptionTypes) => string;
export { parser };