Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
[*] fix parse rss format bug
Browse files Browse the repository at this point in the history
  • Loading branch information
heng30 committed Mar 28, 2024
1 parent 48281d1 commit 5d6be9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions rssbox/src/logic/rss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,10 @@ async fn fetch_entry(config: SyncItem) -> Result<Vec<RssEntry>, Box<dyn std::err
let s = html2text::from_read(s.as_bytes(), usize::MAX)
.trim()
.to_string();
if s.len() > 200 {
format!("{}...", &s[..200])

let s_chars = s.chars().collect::<Vec<_>>();
if s_chars.len() > 200 {
format!("{}...", s_chars[..200].iter().collect::<String>())
} else {
s
}
Expand Down
2 changes: 1 addition & 1 deletion rssbox/src/version.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub static VERSION: &str = "v0.5.1";
pub static VERSION: &str = "v0.5.2";

0 comments on commit 5d6be9f

Please sign in to comment.