Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
With a markdown document hello.md like so:
# hello, world
Repeated calls to markdown.parse produce different kinds of garbage at the end:
node> markdown.parse(fs.readFileSync('hello.md', 'utf8'));
'<h1>hello, world</h1>^?>\n '
node> markdown.parse(fs.readFileSync('hello.md', 'utf8'));
'<h1>hello, world</h1>'
node> markdown.parse(fs.readFileSync('hello.md', 'utf8'));
'<h1>hello, world</h1>{\u0007\ufffd\u000f\ufffd\u0015'
node> markdown.parse(fs.readFileSync('hello.md', 'utf8'));
'<h1>hello, world</h1>\u0002'
node> markdown.parse(fs.readFileSync('hello.md', 'utf8'));
'<h1>hello, world</h1>'
node> markdown.parse(fs.readFileSync('hello.md', 'utf8'));
'<h1>hello, world</h1>^?C\b\ufffd^?C\b\ufffd\u0001'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.