Changes necessary for latest cargo packages
This commit is contained in:
parent
58dae5df6f
commit
2073b7b132
@ -140,29 +140,6 @@ impl Transformer for StripHtml {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct InlineRemoteStyle<'a> {
|
|
||||||
base_url: &'a Option<Url>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl<'a> Transformer for InlineRemoteStyle<'a> {
|
|
||||||
async fn transform(&self, _: &Option<Url>, html: &str) -> Result<String, TransformError> {
|
|
||||||
//info!("HTML:\n{html}");
|
|
||||||
Ok(
|
|
||||||
match CSSInliner::options()
|
|
||||||
.base_url(self.base_url.clone())
|
|
||||||
.build()
|
|
||||||
.inline(&html)
|
|
||||||
{
|
|
||||||
Ok(inlined_html) => inlined_html,
|
|
||||||
Err(err) => {
|
|
||||||
error!("failed to inline remote CSS: {err}");
|
|
||||||
html.to_string()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
struct InlineStyle;
|
struct InlineStyle;
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
|||||||
@ -496,10 +496,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
|||||||
}
|
}
|
||||||
Msg::MultiMsg(msgs) => msgs.into_iter().for_each(|msg| update(msg, model, orders)),
|
Msg::MultiMsg(msgs) => msgs.into_iter().for_each(|msg| update(msg, model, orders)),
|
||||||
Msg::CopyToClipboard(text) => {
|
Msg::CopyToClipboard(text) => {
|
||||||
let clipboard = seed::window()
|
let clipboard = seed::window().navigator().clipboard();
|
||||||
.navigator()
|
|
||||||
.clipboard()
|
|
||||||
.expect("couldn't get clipboard");
|
|
||||||
orders.perform_cmd(async move {
|
orders.perform_cmd(async move {
|
||||||
wasm_bindgen_futures::JsFuture::from(clipboard.write_text(&text))
|
wasm_bindgen_futures::JsFuture::from(clipboard.write_text(&text))
|
||||||
.await
|
.await
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user