BlockQuote

Trait BlockQuote 

Source
pub trait BlockQuote {
    // Required methods
    fn to_block_quote(&self) -> String;
    fn to_block_quote_multi_line(&self) -> String;
}
Expand description

An extension trait for block quote transformation.

Required Methods§

Source

fn to_block_quote(&self) -> String

Transforms the given text into a block quote.

§Example
use markdown_composer::transforms::BlockQuote;

let text = "To quote";
let quoted = text.to_block_quote();
assert_eq!(quoted, "> To quote");
§Note

Multiline quotes should be created using [block_quote_multi_line](trait.BlockQuote.html#tymethod. block_quote_multi_line) function.

Source

fn to_block_quote_multi_line(&self) -> String

Transforms the given text into a multiline block quote.

This method does take newlines into account and splits the text after them to create a block quote that spans over multiple lines instead of a single one.

§Example
use markdown_composer::transforms::BlockQuote;

let text = "To quote\nor not to quote";
let quoted = text.to_block_quote_multi_line();
assert_eq!(quoted, "> To quote\n> or not to quote");

Implementors§

Source§

impl<T> BlockQuote for T
where T: AsRef<str>,