Skip to content

Commit

Permalink
fix: permit nesting list
Browse files Browse the repository at this point in the history
  • Loading branch information
momeemt committed Dec 4, 2024
1 parent f4a1c13 commit ef312ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/ordered_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ pub fn ordered_list(Json(args): Json<Vec<Value>>) -> FnResult<String> {
let mut items_str = String::new();
for item in items {
if item.starts_with("<UnorderedList>") || item.starts_with("<OrderedList>") {
return Err(WithReturnCode::new(
anyhow::anyhow!("items cannot contain another list"),
1,
));
items_str.push_str(&item);
} else {
items_str.push_str(&format!("<ListItem>{}</ListItem>", item));
}
Expand Down
5 changes: 1 addition & 4 deletions src/unordered_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ pub fn unordered_list(Json(args): Json<Vec<Value>>) -> FnResult<String> {
let mut items_str = String::new();
for item in items {
if item.starts_with("<UnorderedList>") || item.starts_with("<OrderedList>") {
return Err(WithReturnCode::new(
anyhow::anyhow!("items cannot contain another list"),
1,
));
items_str.push_str(&item);
} else {
items_str.push_str(&format!("<ListItem>{}</ListItem>", item));
}
Expand Down

0 comments on commit ef312ba

Please sign in to comment.