Skip to content

Commit

Permalink
adds test/spec
Browse files Browse the repository at this point in the history
  • Loading branch information
rsms committed Oct 15, 2020
1 parent 7ce2301 commit 96d9547
Show file tree
Hide file tree
Showing 3 changed files with 9,735 additions and 1 deletion.
28 changes: 28 additions & 0 deletions test/spec/spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const fs = require("fs")
const markdown = require('../../dist/markdown.node.js')
const { exit } = require("../testutil")

// https://spec.commonmark.org
const source = fs.readFileSync(__dirname + "/spec.md")

const timeLabel = `markdown.parse("spec.md")`
console.time(timeLabel)
let html = markdown.parse(source)
console.timeEnd(timeLabel)

html = `
<html lang="en">
<head>
<meta charset="utf-8">
<title>Markdown spec</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
${html}
</body>
</html>
`.trim()

const outfile = __dirname + "/spec.html"
fs.writeFileSync(outfile, html, "utf8")
exit()
Loading

1 comment on commit 96d9547

@cabe56
Copy link

@cabe56 cabe56 commented on 96d9547 Jul 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rsms where can I find the spec.txt file mentioned in spec.md?

I want to lend a hand with spec.md and thought the place to propose a change would be the spec.txt file.

Please sign in to comment.