Skip to content

Instantly share code, notes, and snippets.

View hober's full-sized avatar
🏳️‍⚧️
Putting the L and T in LGBT

Theresa O'Connor hober

🏳️‍⚧️
Putting the L and T in LGBT
View GitHub Profile
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'));
var sys = require('sys');
var browser = require('jsdom/browser')
var domToHtml = require('jsdom/browser/domtohtml').domToHtml;
var DOM = browser.browserAugmentation(require('jsdom/level2/core').dom.level2.core)
var doc = new DOM.Document('html');
doc.appendChild(doc.createElement('html'));
var headEl = doc.createElement('head');
Type '.help' for options.
^[[0Gnode> ^[[0K^[[0G^[[6C
^[[0G^[[0Gnode> ^[[0K^[[0G^[[6Ca
a
^[[0GReferenceError: a is not defined
at [object Context]:1:1
at Interface.<anonymous> (repl:77:19)
at Interface.emit (events:26:26)
at Interface._ttyWrite (readline:221:12)
/* Using aredridel/html5 and tmpvar/jsdom */
var sys = require('sys');
var HTML5 = require('html5');
var p = new HTML5.Parser("<p>hello, world");
p.parse();
var doc = p.document;