diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 6841b5a35f..2afffca3c0 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1591,13 +1591,17 @@ RouteTimeAxisView::update_playlist_tip () take_name = take_name.substr (idx + group_string.length()); /* set the playlist button tooltip to the take name */ - ARDOUR_UI::instance()->set_tip (playlist_button,string_compose(_("Take: %1.%2"), rg->name(), take_name)); + ARDOUR_UI::instance()->set_tip ( + playlist_button, + string_compose(_("Take: %1.%2"), escape_angled_brackets (rg->name()), escape_angled_brackets (take_name)) + ); + return; } } /* set the playlist button tooltip to the playlist name */ - ARDOUR_UI::instance()->set_tip (playlist_button, _("Playlist") + std::string(": ") + track()->playlist()->name()); + ARDOUR_UI::instance()->set_tip (playlist_button, _("Playlist") + std::string(": ") + escape_angled_brackets (track()->playlist()->name())); } diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 96bee1a87b..b8594b7b2f 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include "pbd/file_utils.h" @@ -680,6 +681,16 @@ escape_underscores (string const & s) return o; } +/** Replace < and > with < and > respectively to make < > display correctly in markup strings */ +string +escape_angled_brackets (string const & s) +{ + string o = s; + boost::replace_all (o, "<", "<"); + boost::replace_all (o, ">", ">"); + return o; +} + Gdk::Color unique_random_color (list& used_colors) { diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h index 699cd31981..7137f273c6 100644 --- a/gtk2_ardour/utils.h +++ b/gtk2_ardour/utils.h @@ -79,6 +79,7 @@ void set_pango_fontsize (); void resize_window_to_proportion_of_monitor (Gtk::Window*, int, int); std::string escape_underscores (std::string const &); +std::string escape_angled_brackets (std::string const &); Gdk::Color unique_random_color (std::list &);