Created
September 24, 2014 07:49
-
-
Save michaelrhodes/385887d4744a82ba63e4 to your computer and use it in GitHub Desktop.
Using domify on the server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sandboxed = require('sandboxed-module') | |
var domino = require('domino') | |
var domify = sandboxed.require('domify', { | |
globals: { document: domino.createDocument() } | |
}) | |
var el = domify('<p>Hello, Dexter Morgan</p>') | |
el.classList.add('message') | |
console.log(el.outerHTML) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment