16 lines
348 B
TypeScript
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";
|
|
},
|
|
});
|
|
}
|