pub struct Converter { /* private fields */ }
Expand description
§Converter
Converts markup to HTML
Implementations§
source§impl Converter
impl Converter
pub fn new() -> Self
sourcepub fn convert_to_html(&mut self, markup: &str) -> String
pub fn convert_to_html(&mut self, markup: &str) -> String
Converts markup to HTML
§Arguments
markup
- The markup to convert
§Returns
String
- The HTML
§Examples
use darkdown::converter::converter::Converter;
let mut converter = Converter::new();
let html = converter.convert_to_html("@ Title");
assert_eq!(html, "<h1>Title</h1>");
let html = converter.convert_to_html("**Bold**");
assert_eq!(html, "<strong>Bold</strong>");
Auto Trait Implementations§
impl RefUnwindSafe for Converter
impl Send for Converter
impl Sync for Converter
impl Unpin for Converter
impl UnwindSafe for Converter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more