mirror of
https://github.com/outline/outline.git
synced 2026-05-08 02:50:30 -05:00
chore(deps-dev): bump @types/node from 20.14.2 to 20.17.14 (#8261)
* chore(deps-dev): bump @types/node from 20.14.2 to 20.17.14 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.2 to 20.17.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * tsc * tsc --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@@ -67,7 +67,7 @@ export class DocumentConverter {
|
||||
}
|
||||
|
||||
public static async htmlToMarkdown(content: Buffer | string) {
|
||||
if (content instanceof Buffer) {
|
||||
if (typeof content !== "string") {
|
||||
content = content.toString("utf8");
|
||||
}
|
||||
|
||||
@@ -117,26 +117,26 @@ export class DocumentConverter {
|
||||
}
|
||||
|
||||
public static fileToMarkdown(content: Buffer | string) {
|
||||
if (content instanceof Buffer) {
|
||||
if (typeof content !== "string") {
|
||||
content = content.toString("utf8");
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
public static async confluenceToMarkdown(value: Buffer | string) {
|
||||
if (value instanceof Buffer) {
|
||||
value = value.toString("utf8");
|
||||
public static async confluenceToMarkdown(content: Buffer | string) {
|
||||
if (typeof content !== "string") {
|
||||
content = content.toString("utf8");
|
||||
}
|
||||
|
||||
// We're only supporting the output from Confluence here, regular Word documents should call
|
||||
// into the docxToMarkdown importer. See: https://jira.atlassian.com/browse/CONFSERVER-38237
|
||||
if (!value.includes("Content-Type: multipart/related")) {
|
||||
if (!content.includes("Content-Type: multipart/related")) {
|
||||
throw FileImportError("Unsupported Word file");
|
||||
}
|
||||
|
||||
// Confluence "Word" documents are actually just multi-part email messages, so we can use
|
||||
// mailparser to parse the content.
|
||||
const parsed = await simpleParser(value);
|
||||
const parsed = await simpleParser(content);
|
||||
if (!parsed.html) {
|
||||
throw FileImportError("Unsupported Word file (No content found)");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user