feat: italic/emphasis support

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-04-01 16:59:39 -03:00
parent 46125ea7f7
commit b12657972c

View File

@@ -49,6 +49,18 @@ pub fn to_tumblr_npf<'a>(ast: &'a Node<'a, RefCell<Ast>>) -> Result<RefCell<NPF>
});
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)),
_ => (),
}