diff --git a/src/core/server/services/users/download/download.ts b/src/core/server/services/users/download/download.ts index b3aa020b5..f95713f0f 100644 --- a/src/core/server/services/users/download/download.ts +++ b/src/core/server/services/users/download/download.ts @@ -2,6 +2,7 @@ import archiver from "archiver"; import stringify from "csv-stringify"; import DataLoader from "dataloader"; import { Response } from "express"; +import htmlToText from "html-to-text"; import { kebabCase } from "lodash"; import { Db } from "mongodb"; @@ -52,7 +53,7 @@ export async function sendUserDownload( let commentBatch: Array> = []; // Generate the filename of the file that the user will download. - const filename = `talk-${kebabCase(user.username)}-${kebabCase( + const filename = `coral-${kebabCase(user.username)}-${kebabCase( formatter.format(latestContentDate) )}.zip`; @@ -107,7 +108,7 @@ export async function sendUserDownload( const urlBuilder = new URL(storyURL); urlBuilder.searchParams.set("commentID", commentID); const commentURL = urlBuilder.href; - const body = revision.body; + const body = htmlToText.fromString(revision.body); csv.write([commentID, createdAt, storyURL, commentURL, body]); }