Skip to content

Commit

Permalink
build(dependencies): 🧱 update crates
Browse files Browse the repository at this point in the history
❗ bump nom from 7.1.3 to 8.0.0
    Updating bitflags v2.7.0 -> v2.8.0
    Updating indexmap v2.7.0 -> v2.7.1
    Updating log v0.4.22 -> v0.4.25
    Updating ryu v1.0.18 -> v1.0.19
    Updating serde_json v1.0.135 -> v1.0.137
    Updating unicode-ident v1.0.14 -> v1.0.16
  • Loading branch information
rodneylab committed Jan 28, 2025
1 parent ec1fd43 commit 4e79c8a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
35 changes: 14 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test
aho-corasick = "1.1.3"
deunicode = "1.6.0"
getrandom = { version = "0.2.15", features = ["js"] }
# getrandom = { version = "0.3.1", features = ["wasm_js"] }
html5ever = "0.29.0"
js-sys = "0.3.72"
mrml = { version = "4.0.1", features = ["parse", "render"], default-features = false }
nom = { version = "7.1.3", features = ["alloc"] }
nom = { version = "8.0.0", features = ["alloc"] }
pulldown-cmark = "0.12.2"
pulldown-cmark-escape = "0.11.0"
serde = { version = "1.0.217", features = ["derive"] }
Expand Down
11 changes: 6 additions & 5 deletions src/inline_html/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use nom::{
combinator::recognize,
multi::many1_count,
sequence::{delimited, pair},
IResult,
IResult, Parser,
};

#[derive(Debug, PartialEq, Eq, Hash)]
Expand All @@ -20,13 +20,14 @@ fn parse_html_tag_content(line: &str) -> IResult<&str, (&str, &str)> {
let (attributes, (tag_name, _space)) = pair(
recognize(many1_count(alt((alphanumeric1, tag("-"))))),
multispace0,
)(tag_content)?;
)
.parse(tag_content)?;
Ok((remainder, (tag_name, attributes)))
}

fn parse_closing_html_tag(line: &str) -> IResult<&str, (&str, &str, InlineHTMLTagType)> {
let (remaining_line, (tag_name, tag_attributes)) =
delimited(tag("</"), parse_html_tag_content, tag(">"))(line)?;
delimited(tag("</"), parse_html_tag_content, tag(">")).parse(line)?;
Ok((
remaining_line,
(
Expand All @@ -39,7 +40,7 @@ fn parse_closing_html_tag(line: &str) -> IResult<&str, (&str, &str, InlineHTMLTa

fn parse_opening_html_tag(line: &str) -> IResult<&str, (&str, &str, InlineHTMLTagType)> {
let (remaining_line, (tag_name, tag_attributes)) =
delimited(tag("<"), parse_html_tag_content, tag(">"))(line)?;
delimited(tag("<"), parse_html_tag_content, tag(">")).parse(line)?;
Ok((
remaining_line,
(
Expand All @@ -51,7 +52,7 @@ fn parse_opening_html_tag(line: &str) -> IResult<&str, (&str, &str, InlineHTMLTa
}

pub fn parse_node(html_node: &str) -> Option<InlineHTMLTagType> {
match alt((parse_opening_html_tag, parse_closing_html_tag))(html_node) {
match alt((parse_opening_html_tag, parse_closing_html_tag)).parse(html_node) {
Ok((_, (_, _, tag_type))) => Some(tag_type),
Err(_) => None,
}
Expand Down

0 comments on commit 4e79c8a

Please sign in to comment.