8000 GitHub - whir-tools/dodom: Turn arbitrary HTML strings into DOM elements · GitHub
[go: up one dir, main page]

Skip to content
whir-toolsPublic

About

Turn arbitrary HTML strings into DOM elements

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dodom

Turn arbitrary HTML strings into DOM elements.


var dodom = require('whir-dodom');

var frag = dodom('<h1>hi there</h1>');

frag.querySelector('h1').textContent === 'hi there'; // true

It's not going to catch a load of edge cases, but plenty for simple things. If you need more, then domify will be a better choice.

@todo

  • xss filtering
  • allow variadic invocation (template > insert a holder at some point > return composed fragment)

About

Turn arbitrary HTML strings into DOM elements

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0