Skip to content

Commit

Permalink
Add the test case for very large markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
VitalikL committed Oct 5, 2024
1 parent aff4fec commit 988a9b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ let validateContent = async function () {
validDate.add(1, 'd')
}

let content = metaMarked(fs.readFileSync(markdownFile, "utf-8"))
let c = fs.readFileSync(markdownFile, "utf-8")

if (c.length > 40000) {
fail(`Potentially very long document over 40k characters: \`${markdownFile}\`.`)
}

let content = metaMarked(c)

if (!content.meta.title) {
fail(`Error in the title field: \`${markdownFile}\`. No title provided`)
Expand Down

0 comments on commit 988a9b4

Please sign in to comment.