mirror of
https://github.com/docmost/docmost.git
synced 2026-05-06 22:03:06 +08:00
xwiki html import cleanup (#1969)
This commit is contained in:
@@ -50,6 +50,7 @@ export async function formatImportHtml(opts: {
|
||||
}
|
||||
|
||||
notionFormatter($, $root);
|
||||
xwikiFormatter($, $root);
|
||||
defaultHtmlFormatter($, $root);
|
||||
|
||||
const backlinks = await rewriteInternalLinksToMentionHtml(
|
||||
@@ -69,6 +70,14 @@ export async function formatImportHtml(opts: {
|
||||
};
|
||||
}
|
||||
|
||||
export function xwikiFormatter($: CheerioAPI, $root: Cheerio<any>) {
|
||||
const $content = $root.find('#xwikicontent');
|
||||
if ($content.length) {
|
||||
$root.children().remove();
|
||||
$root.append($content.contents());
|
||||
}
|
||||
}
|
||||
|
||||
export function defaultHtmlFormatter($: CheerioAPI, $root: Cheerio<any>) {
|
||||
$root.find('a[href]').each((_, el) => {
|
||||
const $el = $(el);
|
||||
|
||||
Reference in New Issue
Block a user