增加tts初步支持,大文件存储改用lfs
This commit is contained in:
1 parent
cd305af1fb
commit
e03614a674
12 files changed
+121
-274
No files matched your search
@@ -52,8 +52,15 @@ export class DocuBuilder {
|
||||
|
||||
async as_markdown() {
|
||||
const turndownService = new TurndownService();
|
||||
const md_page = turndownService.turndown(await this.as_html_page());
|
||||
|
||||
const html_page = await this.as_html_page();
|
||||
const cleaned_html = html_page.replace(
|
||||
`/<[^>]class="[^"]\bc_title\b[^"]"[^>]>([\s\S]*?)</[^>]+>/gi`,
|
||||
"# $1",
|
||||
).replace(
|
||||
/<script\b[^>]*>[\s\S]*?<\/script>|<style\b[^>]*>[\s\S]*?<\/style>/gi,
|
||||
"",
|
||||
);
|
||||
const md_page = turndownService.turndown(cleaned_html);
|
||||
this.pages = [md_page];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user