htmd 0.5.4

A turndown.js inspired HTML to Markdown converter.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{
    Element,
    element_handler::{HandlerResult, Handlers},
    options::BrStyle,
    serialize_if_faithful,
};

pub(super) fn br_handler(handlers: &dyn Handlers, element: Element) -> Option<HandlerResult> {
    serialize_if_faithful!(handlers, element, 0);

    match handlers.options().br_style {
        BrStyle::TwoSpaces => Some("  \n".into()),
        BrStyle::Backslash => Some("\\\n".into()),
    }
}