Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function convertToMarkdown(contentState: Draft.ContentState): string {
const htmlContent = stateToHTML(contentState);
const td = new TurndownService.default({
headingStyle: "atx",
hr: "***",
codeBlockStyle: "fenced"
});
td.addRule("codeblocks", {
filter: ["pre"],
replacement: codeBlocksSerializer
});
return td.turndown(htmlContent);
}