xwiki html import cleanup (#1969)
This commit is contained in:
parent
5de1c8e3ed
commit
b5803f42da
1 changed files with 9 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue