Skip to content

Commit 07a7f20

Browse files
committed
upgrade html5gum, fix #148
1 parent 5702733 commit 07a7f20

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rayon = "1.5.1"
1616
pulldown-cmark = "0.8.0"
1717
blake3 = "1.0.0"
1818

19-
html5gum = "0.4.0"
19+
html5gum = "0.5.0"
2020
jwalk = "0.6.0"
2121
patricia_tree = "0.3.1"
2222
bumpalo = { version = "3.8.0", features = ["collections"] }

src/html/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ fn test_html_parsing_malformed_script() {
373373

374374
assert_eq!(
375375
links.collect::<Vec<_>>(),
376-
&[used_link("foo"), used_link("wut"), used_link("bar")]
376+
&[used_link("foo"), used_link("bar")]
377377
);
378378
}
379379

src/html/parser.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bumpalo::collections::String as BumpString;
22
use bumpalo::collections::Vec as BumpVec;
33
use bumpalo::Bump;
4-
use html5gum::{Emitter, Error};
4+
use html5gum::{Emitter, Error, State};
55

66
use crate::html::{DefinedLink, Document, Link, UsedLink};
77
use crate::paragraph::ParagraphWalker;
@@ -194,11 +194,11 @@ where
194194
self.current_tag_is_closing = true;
195195
}
196196

197-
fn emit_current_tag(&mut self) {
197+
fn emit_current_tag(&mut self) -> Option<State> {
198198
self.flush_old_attribute();
199199

200+
self.buffers.last_start_tag.clear();
200201
if !self.current_tag_is_closing {
201-
self.buffers.last_start_tag.clear();
202202
self.buffers
203203
.last_start_tag
204204
.extend(&self.buffers.current_tag_name);
@@ -225,6 +225,7 @@ where
225225
}
226226

227227
self.buffers.current_tag_name.clear();
228+
html5gum::naive_next_state(&self.buffers.last_start_tag)
228229
}
229230

230231
fn set_self_closing(&mut self) {

0 commit comments

Comments
 (0)