Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
escape & character.
  • Loading branch information
sigmaSd committed Jul 11, 2018
1 parent 3699286 commit 4457465
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/widgets/station_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ impl StationRow {
location_label.set_text(&format!("{} {}", station.country, station.state));
codec_label.set_text(&station.codec);

if station.homepage != "" {homepage_label.set_markup(&format!("<a href=\"{}\">{}</a>", station.homepage, station.homepage));
if station.homepage != "" {
//escape & character
let station_homepage= match station.homepage.find("&") {
None => station.homepage.clone(),
Some(_) => station.homepage.replace("&", "&amp;"),
};
homepage_label.set_markup(&format!("<a href=\"{}\">{}</a>", station_homepage, station_homepage));
}else{homepage_label.set_text("—");}

if station.tags != "" {tags_label.set_text(&station.tags);
Expand Down

0 comments on commit 4457465

Please sign in to comment.