fix: Paragraphs in table cells skipped in import
Port HTML importer rules from enterprise fork
This commit is contained in:
15
server/utils/turndown/underlines.ts
Normal file
15
server/utils/turndown/underlines.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import TurndownService from "turndown";
|
||||
|
||||
/**
|
||||
* A turndown plugin for converting u tags to underlines.
|
||||
*
|
||||
* @param turndownService The TurndownService instance.
|
||||
*/
|
||||
export default function underlines(turndownService: TurndownService) {
|
||||
turndownService.addRule("underlines", {
|
||||
filter: ["u"],
|
||||
replacement(content) {
|
||||
return `__${content.trim()}__`;
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user