Skip to content

Commit 8ba833f

Browse files
committed
Add some trace logging for event processing
This adds some trace logging to help debug markdown parsing and HTML parsing.
1 parent eaa778b commit 8ba833f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/mdbook-html/src/html/tree.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use pulldown_cmark::{Alignment, CodeBlockKind, CowStr, Event, LinkType, Tag, Tag
1919
use std::borrow::Cow;
2020
use std::collections::{HashMap, HashSet};
2121
use std::ops::Deref;
22-
use tracing::{error, warn};
22+
use tracing::{error, trace, warn};
2323

2424
/// Helper to create a [`QualName`].
2525
macro_rules! attr_qual_name {
@@ -300,6 +300,7 @@ where
300300
/// The main processing loop. Processes all events until the end.
301301
fn process_events(&mut self) {
302302
while let Some(event) = self.events.next() {
303+
trace!("event={event:?}");
303304
match event {
304305
Event::Start(tag) => self.start_tag(tag),
305306
Event::End(tag) => {
@@ -599,6 +600,7 @@ where
599600
let tokens = parse_html(&html);
600601
let mut is_raw = false;
601602
for token in tokens {
603+
trace!("html token={token:?}");
602604
match token {
603605
Token::DoctypeToken(_) => {}
604606
Token::TagToken(tag) => {

0 commit comments

Comments
 (0)