Skip to content

Commit

Permalink
Escape tray tooltip text
Browse files Browse the repository at this point in the history
Fix errors when the tooltip set by the tray apps contains markup characters
  • Loading branch information
pol-rivero committed Jan 10, 2025
1 parent 369c81d commit 0992bf1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/sni/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ ToolTip get_variant<ToolTip>(const Glib::VariantBase& value) {
result.text = get_variant<Glib::ustring>(container.get_child(2));
auto description = get_variant<Glib::ustring>(container.get_child(3));
if (!description.empty()) {
result.text = fmt::format("<b>{}</b>\n{}", result.text, description);
auto escapedDescription = Glib::Markup::escape_text(description);
result.text = fmt::format("<b>{}</b>\n{}", result.text, escapedDescription);
}
return result;
}
Expand Down

0 comments on commit 0992bf1

Please sign in to comment.