Add a doctest for blank_line() #16

Merged
cadey merged 3 commits from :blank-line-doctest into main 2020-12-10 12:47:33 +00:00
1 changed files with 11 additions and 0 deletions
Showing only changes of commit adf82e9d9b - Show all commits

View File

@ -23,6 +23,17 @@ impl Builder {
/// This is equivilent to calling [`text()`] with an empty string, or pushing a blank /// This is equivilent to calling [`text()`] with an empty string, or pushing a blank
/// [`Node`] /// [`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() /// [`text()`]: Self::text()
pub fn blank_line(mut self) -> Self { pub fn blank_line(mut self) -> Self {
self.nodes.push(Node::blank()); self.nodes.push(Node::blank());