Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve escaping in yuck #1194

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ sysinfo = "0.31.2"
thiserror = "1.0"
tokio-util = "0.7.11"
tokio = { version = "1.39.2", features = ["full"] }
unescape = "0.1"
unescaper = "0.1"
wait-timeout = "0.2"
zbus = { version = "4.4.0", default-features = false, features = ["tokio"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/eww/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ simple-signal.workspace = true
sysinfo = { workspace = true }
tokio-util.workspace = true
tokio = { workspace = true, features = ["full"] }
unescape.workspace = true
unescaper.workspace = true
wait-timeout.workspace = true
zbus = { workspace = true, default-features = false, features = ["tokio"] }
2 changes: 1 addition & 1 deletion crates/eww/src/widgets/widget_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result<gtk::Label> {
}
};

let text = unescape::unescape(&text).context(format!("Failed to unescape label text {}", &text))?;
let text = if text.contains("\\u") { unescaper::unescape(&text)? } else { text };
let text = if unindent { util::unindent(&text) } else { text };
gtk_widget.set_text(&text);
},
Expand Down
Loading