Skip to content

Commit

Permalink
Upgrade pulldown-cmark to 0.10.0 (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScratchCat458 authored Mar 31, 2024
1 parent 6a0767a commit 50f1163
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ categories = ["text-processing"]

[dependencies]
once_cell = "1.18.0"
pulldown-cmark = { version = "0.9.3", default-features = false }
pulldown-cmark = { version = "0.10.0", default-features = false }
regex = "1.9.3"
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use std::fmt::Write;
use std::slice::Iter;

pub use pulldown_cmark::HeadingLevel;
use pulldown_cmark::{Event, Options as CmarkOptions, Parser, Tag};
use pulldown_cmark::{Event, Options as CmarkOptions, Parser, Tag, TagEnd};

pub use render::{ItemSymbol, Options};
pub use slug::{GitHubSlugifier, Slugify};
Expand Down Expand Up @@ -127,13 +127,13 @@ impl<'a> TableOfContents<'a> {
for event in events {
let event = event.borrow();
match event {
Event::Start(Tag::Heading(level, _, _)) => {
Event::Start(Tag::Heading { level, .. }) => {
current = Some(Heading {
events: Vec::new(),
level: *level,
});
}
Event::End(Tag::Heading(level, _, _)) => {
Event::End(TagEnd::Heading(level)) => {
let heading = current.take().unwrap();
assert_eq!(heading.level, *level);
headings.push(heading);
Expand Down
6 changes: 3 additions & 3 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::fmt;
use std::fmt::Write;
use std::ops::RangeInclusive;

use pulldown_cmark::{Event, HeadingLevel, Tag};
use pulldown_cmark::{Event, HeadingLevel, Tag, TagEnd};

use crate::slug::{GitHubSlugifier, Slugify};

Expand Down Expand Up @@ -46,8 +46,8 @@ where
for event in events {
let event = event.borrow();
match event {
Event::Start(Tag::Emphasis) | Event::End(Tag::Emphasis) => buf.push('*'),
Event::Start(Tag::Strong) | Event::End(Tag::Strong) => buf.push_str("**"),
Event::Start(Tag::Emphasis) | Event::End(TagEnd::Emphasis) => buf.push('*'),
Event::Start(Tag::Strong) | Event::End(TagEnd::Strong) => buf.push_str("**"),
Event::Text(s) => buf.push_str(s),
Event::Code(s) => {
buf.push('`');
Expand Down

0 comments on commit 50f1163

Please sign in to comment.