Deprecate descriptionPlaintext field

This commit is contained in:
Bad Manners 2024-07-23 17:53:48 -03:00
parent a713adc1ec
commit 688f9b982d
27 changed files with 64 additions and 121 deletions

View file

@ -215,13 +215,18 @@ export const GET: APIRoute<Props, Params> = async ({ props: { story }, site }) =
(_, group1, group2) => `[${group1}](${new URL(group2, site).toString()})`,
);
if (exportFormat === "bbcode") {
return [website, markdownToBbcode(storyDescription).replaceAll(/\n\n\n+/g, "\n\n").trim()];
return [
website,
markdownToBbcode(storyDescription)
.replaceAll(/\n\n\n+/g, "\n\n")
.trim(),
];
} else if (exportFormat === "markdown") {
return [website, storyDescription.replaceAll(/\n\n\n+/g, "\n\n").trim()];
} else {
throw new Error(`Unhandled export format "${exportFormat}"`);
}
})
}),
);
const storyHeader =