about summary refs log tree commit diff
path: root/templates
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-09-07 16:49:23 +0300
committerVika <vika@fireburn.ru>2024-09-07 16:49:23 +0300
commit2b01ce151272edc85ff975c72780532f35d3b3f1 (patch)
tree59a30069883bbc6899f3e0849eea56b98d5b922e /templates
parentbd1fb7afd2e0e965989dcfbffc2ff7f4ef828d5d (diff)
If like/bookmark-of name is empty, pretend it isn't there
Diffstat (limited to 'templates')
-rw-r--r--templates/src/mf2.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/templates/src/mf2.rs b/templates/src/mf2.rs
index 550adfc..643db15 100644
--- a/templates/src/mf2.rs
+++ b/templates/src/mf2.rs
@@ -60,6 +60,7 @@ markup::define! {
                         a."u-like-of"[href=likeof["properties"]["url"][0].as_str().unwrap()] {
                             @likeof["properties"]["name"][0]
                             .as_str()
+                            .and_then(|s| if s.trim().is_empty() { None } else { Some(s) })
                             .unwrap_or_else(|| likeof["properties"]["url"][0].as_str().unwrap())
                         }
                     }
@@ -77,6 +78,7 @@ markup::define! {
                         a."u-bookmark-of"[href=bookmarkof["properties"]["url"][0].as_str().unwrap()] {
                             @bookmarkof["properties"]["name"][0]
                                 .as_str()
+                                .and_then(|s| if s.trim().is_empty() { None } else { Some(s) })
                                 .unwrap_or_else(|| bookmarkof["properties"]["url"][0].as_str().unwrap())
                         }
                     }