/*! domx-stringify - v1.0.0 - 2014-11-26 * http://esha.github.io/domx-stringify/ * Copyright (c) 2014 ESHA Research; Licensed MIT, GPL */ !function(a){"use strict";var b=a.x,c=b._,d=c.stringify={version:"1.0.0",map:Array.prototype.map,specialPrefix:"_",markup:{"\n":"
","<":'<',">":'>',"</'," ":"    "},plain:{"\n":"\n","<":"<",">":">","":"/>"," ":" "},type:{attr:"attr",string:"string",tag:"tag"},print:function(a,b,c){var e=a.tagName.toLowerCase(),f=b?d.markup:d.plain,g=d.isInline(a)?"":f["\n"],h=d.content(a,b,c+f[" "],g),i=d.attrs(a,b),j=b?d.special(a):[];b&&(e=d.mark(e,d.type.tag));var k=d.mark(f["<"]+e+(i?" "+i:"")+f[">"],j),l=d.mark(f[""],j);return h&&g&&(h=g+h+g+c),c+k+h+l},isInline:function(a){return"inline"===(a.currentStyle||window.getComputedStyle(a,"")).display||a.tagName.match(/^(H\d|LI)$/i)},content:function(a,b,c,e){for(var f=[],g=0,h=a.childNodes.length;h>g;g++){var i=a.childNodes[g];if(i.tagName)f.push(d.print(i,b,e?c:""));else if(3===i.nodeType){var j=i.textContent.replace(/^\s+|\s+$/g," ");j.match(/[^\s]/)&&f.push(j)}}return f.join(e)},attrs:function(a,b){return d.map.call(a.attributes,function(a){var c=a.name,e=a.value;return b&&0===c.indexOf(d.specialPrefix)?void 0:b?d.mark(c+(e?"=":""),d.type.attr)+(e?d.mark('"'+e+'"',d.type.string):""):c+(e?'="'+e+'"':"")}).filter(d.notEmpty).join(" ")},special:function(a){return d.map.call(a.attributes,function(a){var b=a.name;return 0===b.indexOf(d.specialPrefix)?b.substr(1)+'="'+a.value+'"':void 0}).filter(d.notEmpty)},mark:function(a,b){return b.length?("string"==typeof b&&(b=['class="'+b+'"']),""+a+""):a},notEmpty:function(a){return void 0!==a&&null!==a&&""!==a}};b.add("stringify",function(a,b){return d.print(this,a||!1,b||"")})}(document);