wrap content in <html><body> element

This commit is contained in:
Hongbo Wu
2024-05-09 11:46:01 +08:00
parent e1990258f1
commit 17708915d9
2 changed files with 17 additions and 14 deletions

View File

@ -675,19 +675,23 @@ export const moveDigestToLibrary = async (user: User, digest: Digest) => {
const chapters = digest.chapters ?? []
const html = `
<div style="text-align: justify;" class="_omnivore_digest">
${chapters
.map(
(chapter) => `
<div>
<a href="${chapter.url}"><h3>${chapter.title} (${chapter.wordCount} words)</h3></a>
<div>
${chapter.summary}
</div>
</div>`
)
.join('')}
</div>`
<html>
<body>
<div style="text-align: justify;" class="_omnivore_digest">
${chapters
.map(
(chapter) => `
<div>
<a href="${chapter.url}"><h3>${chapter.title} (${chapter.wordCount} words)</h3></a>
<div>
${chapter.summary}
</div>
</div>`
)
.join('')}
</div>
</body>
</html>`
const previewImage = await findThumbnail(chapters)

View File

@ -172,7 +172,6 @@ const RESERVED_NAMES = new Set([
'xmpp',
'yaml',
'yml',
'digest',
])
export const validateUsername = (username: string): boolean => {