This commit is contained in:
ivamp 2023-12-12 18:54:57 +08:00
parent 9df49189ec
commit 127e44840d
3 changed files with 16 additions and 1 deletions

View File

@ -20,6 +20,7 @@
"pinia": "^2.0.0",
"pinia-plugin-persistedstate": "^3.2.0",
"roboto-fontface": "*",
"turndown": "^7.1.2",
"vue": "^3.2.0",
"vue-axios": "^3.5.2",
"vue-router": "^4.0.0",

View File

@ -70,6 +70,8 @@ import { getDocument } from "pdfjs-dist";
import "pdfjs-dist/build/pdf.worker.mjs";
import {convertToHtml} from "mammoth/mammoth.browser";
import TurndownService from "turndown";
//
const errorMsg = ref("");
@ -158,7 +160,7 @@ watch(file, (newVal) => {
let messages = resultObject.messages; // Any messages, such as warnings during conversion
// convert to markdown
createData.value.Content = html;
createData.value.Content = TurndownService.turndown(html);
// console.log(html);
// console.log(messages);
});

View File

@ -1337,6 +1337,11 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"
domino@^2.1.6:
version "2.1.6"
resolved "https://registry.npmmirror.com/domino/-/domino-2.1.6.tgz#fe4ace4310526e5e7b9d12c7de01b7f485a57ffe"
integrity sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==
duck@^0.1.12:
version "0.1.12"
resolved "https://registry.npmmirror.com/duck/-/duck-0.1.12.tgz#de7adf758421230b6d7aee799ce42670586b9efa"
@ -2557,6 +2562,13 @@ tsutils@^3.21.0:
dependencies:
tslib "^1.8.1"
turndown@^7.1.2:
version "7.1.2"
resolved "https://registry.npmmirror.com/turndown/-/turndown-7.1.2.tgz#7feb838c78f14241e79ed92a416e0d213e044a29"
integrity sha512-ntI9R7fcUKjqBP6QU8rBK2Ehyt8LAzt3UBT9JR9tgo6GtuKvyUzpayWmeMKJw1DPdXzktvtIT8m2mVXz+bL/Qg==
dependencies:
domino "^2.1.6"
type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
resolved "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"