Compare commits

..

No commits in common. "143862059adcbfad51508d15874f84c4b269bee3" and "780937a368ef5ce757a325cd655708caa5803940" have entirely different histories.

2 changed files with 2 additions and 22 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@because/hype",
"version": "0.0.11",
"version": "0.0.10",
"module": "src/index.tsx",
"type": "module",
"exports": {

View File

@ -54,25 +54,7 @@ const minify = function(el) {
const convert = {
comment: [],
line: [],
script: []
};
const preserveScripts = function (el) {
convert.script = [];
el = el.replace(/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi, function (match, open, content, close) {
if (!content.trim()) return match;
convert.script.push(content);
return open + '[#s# : ' + (convert.script.length - 1) + ' : #s#]' + close;
});
return el;
};
const restoreScripts = function (el) {
convert.script.forEach(function (content, index) {
el = el.replace('[#s# : ' + index + ' : #s#]', content);
});
return el;
line: []
};
const comment = function (el) {
@ -143,13 +125,11 @@ const tidy = function (el) {
const render = function (el, opt) {
el = closing(el);
el = preserveScripts(el);
el = comment(el);
el = entity(el);
el = minify(el);
el = line(el);
el = tidy(el);
el = restoreScripts(el);
return el;
};