Skip to content

Instantly share code, notes, and snippets.

@hober
Created September 4, 2010 19:48
Show Gist options
  • Save hober/565439 to your computer and use it in GitHub Desktop.
Save hober/565439 to your computer and use it in GitHub Desktop.
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