Function indieweb::parse_content_value
source · [−]pub fn parse_content_value<V>(value: V, url: &Url) -> Vec<Fragment>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator, where
V: Into<Value>, Expand description
Converts into a concrete representation of text.
Examples
use std::str::FromStr;
use indieweb::mf2::types::Fragment;
use indieweb::parse_content_value;
assert_eq!(
vec![Fragment { value: "wow".to_string(), html: "<b>wow</b>".to_string(), lang: None }],
parse_content_value(serde_json::Value::String("<b>wow</b>".to_string()), &url::Url::from_str("https://indieweb.org").unwrap())
);