Files
outline/server/utils/turndown/breaks.ts
2023-10-14 17:44:25 -07:00

16 lines
348 B
TypeScript

import TurndownService from "turndown";
/**
* A turndown plugin for converting break tags to newlines.
*
* @param turndownService The TurndownService instance.
*/
export default function breaks(turndownService: TurndownService) {
turndownService.addRule("breaks", {
filter: ["br"],
replacement() {
return "\\n";
},
});
}