Pauan

SJS current appendContent

Oct 5th, 2014
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exports.appendHTMLFragment = function (x, node) {
  2.   if (Array.isArray(x)) {
  3.     array ..@each(function (x) {
  4.       exports.appendHTMLFragment(x, node)
  5.     })
  6.   } else if (typeof x === "string") {
  7.     node.appendChild(document.createTextNode(escapeString(x)))
  8.   } else if (isQuasi(x)) {
  9.     // handle quasis
  10.   } else if (isFragment(x)) {
  11.     // handle DOM fragment
  12.   } else if (x != null) {
  13.     // handle other stuff
  14.   }
  15. }
  16.  
  17. exports.appendContent = function (dom, fragment, block) {
  18.   appendHTMLFragment(fragment, dom)
  19.  
  20.   // Handle other stuff, like block
  21. }
Advertisement
Add Comment
Please, Sign In to add comment