diff --git a/data/ui/article_row.blp b/data/ui/article_row.blp
index ea4c08d..07c4cbe 100644
--- a/data/ui/article_row.blp
+++ b/data/ui/article_row.blp
@@ -32,6 +32,7 @@ template $ArticleRow : Gtk.Box {
wrap: true;
lines: 2;
ellipsize: end;
+ styles ["article-title"]
}
Label excerpt_label {
diff --git a/data/ui/article_row.ui b/data/ui/article_row.ui
index e159ff1..d5eeab9 100644
--- a/data/ui/article_row.ui
+++ b/data/ui/article_row.ui
@@ -46,6 +46,9 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
true
2
3
+
diff --git a/src/api.rs b/src/api.rs
index d683e8f..c3db913 100644
--- a/src/api.rs
+++ b/src/api.rs
@@ -148,7 +148,7 @@ impl Api {
Ok(stream.items.into_iter().map(|item| {
let unread = !item.categories.as_deref().unwrap_or_default()
.iter()
- .any(|c| c.contains("user/-/state/com.google/read"));
+ .any(|c| c == "user/-/state/com.google/read");
let content = item.summary
.as_ref()
.and_then(|s| s.content.clone())
@@ -249,9 +249,20 @@ fn plain_text_excerpt(html: &str, max_chars: usize) -> String {
}
}
let collapsed: String = out.split_whitespace().collect::>().join(" ");
- if collapsed.chars().count() <= max_chars {
- collapsed
+ let decoded = decode_html_entities(&collapsed);
+ if decoded.chars().count() <= max_chars {
+ decoded
} else {
- collapsed.chars().take(max_chars).collect::() + "…"
+ decoded.chars().take(max_chars).collect::() + "…"
}
}
+
+fn decode_html_entities(s: &str) -> String {
+ s.replace("&", "&")
+ .replace("<", "<")
+ .replace(">", ">")
+ .replace(""", "\"")
+ .replace("'", "'")
+ .replace("'", "'")
+ .replace(" ", " ")
+}
diff --git a/src/app.rs b/src/app.rs
index 6e287f0..8e966e9 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -71,8 +71,8 @@ mod imp {
.sidebar-content row:selected {
background-color: alpha(@window_fg_color, 0.22);
}
- .unread-title {
- font-weight: bold;
+ .article-title {
+ font-size: 1.05em;
}"
);
gtk4::style_context_add_provider_for_display(
diff --git a/src/article_row.rs b/src/article_row.rs
index d8877ce..bb239b2 100644
--- a/src/article_row.rs
+++ b/src/article_row.rs
@@ -44,6 +44,7 @@ mod imp {
pub bindings: RefCell>,
pub unread_handler: RefCell