Merge remote-tracking branch 'upstream/main' into alt-text
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
commit
3dadcc05ba
|
@ -18,6 +18,28 @@ impl Builder {
|
|||
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 {
|
||||
self.nodes.push(Node::Link {
|
||||
to: to.into(),
|
||||
|
|
Loading…
Reference in New Issue