javascript:
(function() {
function pageMarkup( doc ) {
var keepSpyral = false;
doc = doc || document;
function array( collection ) {
return Array.prototype.slice.call( collection );
}
function stripSpyralTags( node ) {
var myCopy = node.cloneNode( true );
var nodes = array(myCopy.getElementsByClassName( 'spyral' ));
nodes.forEach( element => { element.remove() });
console.log( node );
return myCopy;
}
function htmlElement() {
return document.childNodes[ 1 ];
}
function markup( el ) {
return ( keepSpyral ? el : stripSpyralTags( el )).outerHTML;
}
return '<!doctype html>\n' + markup( htmlElement());
}
function save() {
var data = pageMarkup();
var a = document.createElement('a');
a.href = 'data:application/html;charset=utf-8,' + encodeURIComponent(data);
a.download = 'page.html';
document.getElementsByTagName('body')[0].appendChild(a);
a.click();
a.remove();
}
save();
}());
void(0);
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.