Merge pull request #250 from snshn/alternate-stylesheets
Embed alternate stylesheets
This commit is contained in:
commit
be097b1d4e
2 changed files with 5 additions and 1 deletions
|
@ -545,7 +545,9 @@ pub fn walk_and_embed_assets(
|
|||
if let Some(link_attr_rel_value) = get_node_attr(node, "rel") {
|
||||
if is_icon(&link_attr_rel_value) {
|
||||
link_type = LinkType::Icon;
|
||||
} else if link_attr_rel_value.eq_ignore_ascii_case("stylesheet") {
|
||||
} else if link_attr_rel_value.eq_ignore_ascii_case("stylesheet")
|
||||
|| link_attr_rel_value.eq_ignore_ascii_case("alternate stylesheet")
|
||||
{
|
||||
link_type = LinkType::Stylesheet;
|
||||
} else if link_attr_rel_value.eq_ignore_ascii_case("preload") {
|
||||
link_type = LinkType::Preload;
|
||||
|
|
|
@ -87,6 +87,7 @@ mod passing {
|
|||
#[test]
|
||||
fn no_css() {
|
||||
let html = "<link rel=\"stylesheet\" href=\"main.css\">\
|
||||
<link rel=\"alternate stylesheet\" href=\"main.css\">\
|
||||
<style>html{background-color: #000;}</style>\
|
||||
<div style=\"display: none;\"></div>";
|
||||
let dom = html::html_to_dom(&html);
|
||||
|
@ -109,6 +110,7 @@ mod passing {
|
|||
"<html>\
|
||||
<head>\
|
||||
<link rel=\"stylesheet\">\
|
||||
<link rel=\"alternate stylesheet\">\
|
||||
<style></style>\
|
||||
</head>\
|
||||
<body>\
|
||||
|
|
Loading…
Reference in a new issue