Add a doctest for the `blank_line()` method
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This adds a simple doctest for `blank_line()` but will not be included in the original PR because it is contingent on the merge of a pending PR for adding the `to_string()` method.
This commit is contained in:
parent
c69ec3b7df
commit
adf82e9d9b
|
@ -23,6 +23,17 @@ impl Builder {
|
|||
/// 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());
|
||||
|
|
Loading…
Reference in New Issue