Merge remote-tracking branch 'upstream/main' into alt-text

This commit is contained in:
Emi Tatsuo 2020-12-10 11:04:22 -05:00
commit 3dadcc05ba
No known key found for this signature in database
GPG Key ID: 68FAB2E2E6DFC98B
1 changed files with 22 additions and 0 deletions

View File

@ -18,6 +18,28 @@ impl Builder {
self self
} }
/// Append a single blank line to the document
///
/// This is equivilent to calling [`text()`] with an empty string, or pushing a blank
/// [`Node`]
///
/// ```
/// # use gemtext::Builder;
/// let greeting = Builder::new()
/// .text("Hello")
/// .blank_line()
/// .text("universe")
/// .to_string();
///
/// assert_eq!(greeting.trim(), "Hello\n\nuniverse");
/// ```
///
/// [`text()`]: Self::text()
pub fn blank_line(mut self) -> Self {
self.nodes.push(Node::blank());
self
}
pub fn link<T: Into<String>>(mut self, to: T, name: Option<String>) -> Builder { pub fn link<T: Into<String>>(mut self, to: T, name: Option<String>) -> Builder {
self.nodes.push(Node::Link { self.nodes.push(Node::Link {
to: to.into(), to: to.into(),