Add support for alt-text in preformatted blocks #15

Merged
cadey merged 5 commits from :alt-text into main 2021-09-08 13:30:32 +00:00
1 changed files with 22 additions and 0 deletions
Showing only changes of commit 3dadcc05ba - Show all commits

View File

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