From b12657972ca0cccf4a411f3564e3c1f89ee8b832 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L. de Mello" Date: Mon, 1 Apr 2024 16:59:39 -0300 Subject: [PATCH] feat: italic/emphasis support --- src/convert.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/convert.rs b/src/convert.rs index d8e190f..0edec33 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -49,6 +49,18 @@ pub fn to_tumblr_npf<'a>(ast: &'a Node<'a, RefCell>) -> Result }); text.push_str(&format!("{} ", &t)) } + NodeValue::Emph => { + let t = utils::extract_text(node); + formatting.push(Formatting { + r#type: FormattingType::Italic, + start: text.chars().count(), + end: text.chars().count() + t.chars().count() + 1, + url: None, + color: None, + blog: None, + }); + text.push_str(&format!("{} ", &t)) + } NodeValue::Text(t) => text.push_str(&format!("{} ", &t)), _ => (), }