Skip to content

Commit

Permalink
fix(Patches): Handle single item values
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Oct 11, 2021
1 parent 7f25135 commit b8ffeda
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rust/src/patches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ impl DomOperation {
if let Some(value) = value.downcast_ref::<serde_json::Value>() {
if let Some(str) = value.as_str() {
return str.to_string();
} else if let Ok(nodes) = serde_json::from_value::<InlineContent>(value.clone()) {
return nodes.to_html("", &context);
} else if let Ok(nodes) = serde_json::from_value::<BlockContent>(value.clone()) {
return nodes.to_html("", &context);
} else if let Ok(nodes) = serde_json::from_value::<Vec<InlineContent>>(value.clone()) {
return nodes.to_html("", &context);
} else if let Ok(nodes) = serde_json::from_value::<Vec<BlockContent>>(value.clone()) {
Expand Down

0 comments on commit b8ffeda

Please sign in to comment.