Skip to content

Commit 97b8dd2

Browse files
committed
fix: syntax error in list.rs
1 parent 80f918f commit 97b8dd2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/list.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ pub fn metadata_ordered_list() -> FnResult<Json<MetaData>> {
2222
}
2323

2424
fn is_list(text: &str) -> bool {
25-
bool is_unordered_list = text.starts_with("<ul>") && text.ends_with("</ul>");
26-
bool is_ordered_list = text.starts_with("<ol>") && text.ends_with("</ol>");
27-
return is_unordered_list && is_ordered_list
25+
let is_unordered_list = text.starts_with("<ul>") && text.ends_with("</ul>");
26+
let is_ordered_list = text.starts_with("<ol>") && text.ends_with("</ol>");
27+
return is_unordered_list && is_ordered_list;
2828
}
2929

3030
#[plugin_fn]
@@ -46,7 +46,7 @@ pub fn unordered_list(Json(args): Json<Vec<Value>>) -> FnResult<String> {
4646
};
4747
let mut result = String::new();
4848
for elem in elems {
49-
if is_list(text) {
49+
if is_list(elem) {
5050
result += elem;
5151
continue;
5252
}
@@ -55,7 +55,6 @@ pub fn unordered_list(Json(args): Json<Vec<Value>>) -> FnResult<String> {
5555
Ok(format!("<ul>{}</ul>", result))
5656
}
5757

58-
5958
#[plugin_fn]
6059
pub fn ordered_list(Json(args): Json<Vec<Value>>) -> FnResult<String> {
6160
if args.len() != 1 {

0 commit comments

Comments
 (0)