forked from lucthev/collapse-whitespace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
whitespace.min.js
1 lines (1 loc) · 2.42 KB
/
whitespace.min.js
1
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.collapse=e()}})(function(){var e,t,r;return function e(t,r,n){function o(u,f){if(!r[u]){if(!t[u]){var a=typeof require=="function"&&require;if(!f&&a)return a(u,!0);if(i)return i(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var d=r[u]={exports:{}};t[u][0].call(d.exports,function(e){var r=t[u][1][e];return o(r?r:e)},d,d.exports,e,t,r,n)}return r[u].exports}var i=typeof require=="function"&&require;for(var u=0;u<n.length;u++)o(n[u]);return o}({1:[function(e,t,r){"use strict";var n=e("void-elements");Object.keys(n).forEach(function(e){n[e.toUpperCase()]=1});var o={};e("block-elements").forEach(function(e){o[e.toUpperCase()]=1});function i(e){return!!(e&&o[e.nodeName])}function u(e){return e.nodeName==="PRE"}function f(e){return!!(e&&n[e.nodeName])}function a(e,t,r){if(!e.firstChild||e.nodeName==="PRE")return;if(typeof t!=="function"){t=i}if(typeof r!=="function"){r=u}var n=null;var o=false;var a=null;var s=d(a,e,r);while(s!==e){if(s.nodeType===3||s.nodeType===4){var c=s.data.replace(/[ \r\n\t]+/g," ");if((!n||/ $/.test(n.data))&&!o&&c[0]===" "){c=c.substr(1)}if(!c){s=l(s);continue}s.data=c;n=s}else if(s.nodeType===1){if(t(s)||s.nodeName==="BR"){if(n){n.data=n.data.replace(/ $/,"")}n=null;o=false}else if(f(s)){n=null;o=true}}else{s=l(s);continue}var p=d(a,s,r);a=s;s=p}if(n){n.data=n.data.replace(/ $/,"");if(!n.data){l(n)}}}function l(e){var t=e.nextSibling||e.parentNode;e.parentNode.removeChild(e);return t}function d(e,t,r){if(e&&e.parentNode===t||r(t)){return t.nextSibling||t.parentNode}return t.firstChild||t.nextSibling||t.parentNode}t.exports=a},{"block-elements":2,"void-elements":3}],2:[function(e,t,r){t.exports=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","section","table","tfoot","ul","video"]},{}],3:[function(e,t,r){t.exports={area:true,base:true,br:true,col:true,embed:true,hr:true,img:true,input:true,keygen:true,link:true,menuitem:true,meta:true,param:true,source:true,track:true,wbr:true}},{}]},{},[1])(1)});