Upgrade dependencies
This commit is contained in:
parent
be07a35d73
commit
51f3adb606
1113
Cargo.lock
generated
1113
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -9,9 +9,9 @@ repository = "https://github.com/badboy/mdbook-toc"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
mdbook = "0.3"
|
mdbook = "0.3"
|
||||||
pulldown-cmark = "0.5"
|
pulldown-cmark = "0.6.1"
|
||||||
pulldown-cmark-to-cmark = "1.2"
|
pulldown-cmark-to-cmark = "2.0.1"
|
||||||
env_logger = "0.6"
|
env_logger = "0.7.1"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
clap = "2.33"
|
clap = "2.33"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
|
@ -35,7 +35,7 @@ impl Preprocessor for Toc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_toc<'a>(toc: &[(i32, CowStr<'a>)]) -> String {
|
fn build_toc<'a>(toc: &[(u32, CowStr<'a>)]) -> String {
|
||||||
let mut result = String::new();
|
let mut result = String::new();
|
||||||
|
|
||||||
for (level, name) in toc {
|
for (level, name) in toc {
|
||||||
|
@ -53,7 +53,7 @@ fn add_toc(content: &str) -> Result<String> {
|
||||||
let mut toc_found = false;
|
let mut toc_found = false;
|
||||||
|
|
||||||
let mut toc_content = vec![];
|
let mut toc_content = vec![];
|
||||||
let mut current_header_level: Option<i32> = None;
|
let mut current_header_level: Option<u32> = None;
|
||||||
|
|
||||||
for e in Parser::new(&content) {
|
for e in Parser::new(&content) {
|
||||||
if let Event::Html(html) = e {
|
if let Event::Html(html) = e {
|
||||||
|
@ -66,13 +66,13 @@ fn add_toc(content: &str) -> Result<String> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Event::Start(Header(lvl)) = e {
|
if let Event::Start(Heading(lvl)) = e {
|
||||||
if lvl < 5 {
|
if lvl < 5 {
|
||||||
current_header_level = Some(lvl);
|
current_header_level = Some(lvl);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if let Event::End(Header(_)) = e {
|
if let Event::End(Heading(_)) = e {
|
||||||
current_header_level = None;
|
current_header_level = None;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue