Skip to content

Commit

Permalink
feat: updated pulldown-cmark
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Mar 12, 2024
1 parent 046c981 commit 51e0a9d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
13 changes: 10 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion harper-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ is-macro = "0.3.0"
itertools = "0.12.1"
once_cell = "1.19.0"
paste = "1.0.14"
pulldown-cmark = "0.9.3"
pulldown-cmark = "0.10.0"
serde = { version = "1.0.197", features = ["derive"] }
smallvec = { version = "1.13.1", features = ["serde"] }
thiserror = "1.0.57"
Expand Down
8 changes: 4 additions & 4 deletions harper-core/src/parsers/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ impl Parser for Markdown {
});
}
pulldown_cmark::Event::Start(tag) => stack.push(tag),
pulldown_cmark::Event::End(pulldown_cmark::Tag::Paragraph)
| pulldown_cmark::Event::End(pulldown_cmark::Tag::Item) => tokens.push(Token {
pulldown_cmark::Event::End(pulldown_cmark::TagEnd::Paragraph)
| pulldown_cmark::Event::End(pulldown_cmark::TagEnd::Item) => tokens.push(Token {
span: Span::new_with_len(traversed_chars, 1),
kind: TokenKind::Newline(1)
}),
Expand Down Expand Up @@ -69,8 +69,8 @@ impl Parser for Markdown {
}

if !(matches!(tag, Tag::Paragraph)
|| matches!(tag, Tag::Link(..))
|| matches!(tag, Tag::Heading(..))
|| matches!(tag, Tag::Link { .. })
|| matches!(tag, Tag::Heading { .. })
|| matches!(tag, Tag::Item)
|| matches!(tag, Tag::TableCell)
|| matches!(tag, Tag::Emphasis)
Expand Down

0 comments on commit 51e0a9d

Please sign in to comment.