self
}
+ pub fn push_para(mut self, para: &Paragraph) -> Self {
+ let tail = if let Some(last_existing_word) = self.words.last_mut() {
+ if let Some(first_new_word) = para.words.first() {
+ if last_existing_word.is_space() ==
+ first_new_word.is_space() {
+ last_existing_word.push_str(&first_new_word.slice());
+ 1
+ } else { 0 }
+ } else { 0 }
+ } else { 0 };
+ self.words.extend_from_slice(¶.words[tail..]);
+ self
+ }
+
pub fn into_box(self) -> Box<dyn TextFragment> { Box::new(self) }
}
});
}
+// TODO:
+// ExtendableIndicator at file header (with an 'active' flag)
+// InReplyToLine, with first line of included paragraph
+// NotificationLog, also with included toot
+// UserListEntry
+// Media
+// FileStatusLine, with priorities
+// MenuKeypressLine
+// And, of course, the HTML parsing