Merge pull request 'Add a doctest for `blank_line()`' (#16) from alch_emii/maj-prs:blank-line-doctest into main
continuous-integration/drone/push Build is failing Details

Reviewed-on: #16
This commit is contained in:
Cadey Ratio 2020-12-10 12:47:31 +00:00
commit d08994c0cb
1 changed files with 11 additions and 0 deletions

View File

@ -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());