mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-09-22 05:39:53 +03:00
inject css with template string to allow for line breaks (#894)
* inject css with template string to allow for line breaks alternative solution would to be implement a struct `JsStringLiteral` with `fmt::Display` that escapes all forbidden codepoints from the spec https://www.ecma-international.org/ecma-262/#sec-literals-string-literals template string literal seems fine as all browsers that tauri supports have had support for them for the past 3-4+ years Signed-off-by: Chip Reed <chip@chip.sh> * chore(changes) adjust change file Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
parent
6ee720eae1
commit
b96b1fb6b8
@ -2,4 +2,4 @@
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
make sure css content injected is inside a string and not injected raw
|
||||
Make sure CSS content loaded with the `loadAsset` API is inside a template string and not injected raw.
|
||||
|
@ -73,7 +73,7 @@ pub fn load(
|
||||
else
|
||||
css.appendChild(document.createTextNode(content))
|
||||
document.getElementsByTagName("head")[0].appendChild(css);
|
||||
}})("{css}")
|
||||
}})(`{css}`)
|
||||
"#,
|
||||
css = asset_str
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user