From c34d77d5d84dc190e0673779a7cbe3b261c422d4 Mon Sep 17 00:00:00 2001 From: Vincent Flyson Date: Fri, 23 Aug 2019 23:06:06 -0400 Subject: [PATCH] Revamp resolve_url() and improve code format --- Cargo.toml | 2 +- src/html.rs | 16 +++++++++---- src/http.rs | 68 +++++++++++++++++------------------------------------ src/main.rs | 15 ++++++++---- 4 files changed, 46 insertions(+), 55 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 14a9cb3..4694a41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "monolith" -version = "2.0.8" +version = "2.0.9" authors = ["Sunshine "] description = "CLI tool for saving web pages as a single HTML file" diff --git a/src/html.rs b/src/html.rs index 100cddd..22052e3 100644 --- a/src/html.rs +++ b/src/html.rs @@ -19,7 +19,8 @@ enum NodeMatch { Other, } -const PNG_PIXEL: &str = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="; +const TRANSPARENT_PIXEL: &str = "data:image/png;base64,\ +iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="; const JS_DOM_EVENT_ATTRS: [&str; 21] = [ // Input @@ -76,7 +77,8 @@ pub fn walk_and_embed_assets( NodeData::Comment { .. } => { // Note: in case of opt_no_js being set to true, there's no need to worry about // getting rid of comments that may contain scripts, e.g.