Add some trace logging for event processing
This adds some trace logging to help debug markdown parsing and HTML parsing.
This commit is contained in:
parent
eaa778bebd
commit
8ba833feb2
1 changed files with 3 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ use pulldown_cmark::{Alignment, CodeBlockKind, CowStr, Event, LinkType, Tag, Tag
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use tracing::{error, warn};
|
use tracing::{error, trace, warn};
|
||||||
|
|
||||||
/// Helper to create a [`QualName`].
|
/// Helper to create a [`QualName`].
|
||||||
macro_rules! attr_qual_name {
|
macro_rules! attr_qual_name {
|
||||||
|
|
@ -300,6 +300,7 @@ where
|
||||||
/// The main processing loop. Processes all events until the end.
|
/// The main processing loop. Processes all events until the end.
|
||||||
fn process_events(&mut self) {
|
fn process_events(&mut self) {
|
||||||
while let Some(event) = self.events.next() {
|
while let Some(event) = self.events.next() {
|
||||||
|
trace!("event={event:?}");
|
||||||
match event {
|
match event {
|
||||||
Event::Start(tag) => self.start_tag(tag),
|
Event::Start(tag) => self.start_tag(tag),
|
||||||
Event::End(tag) => {
|
Event::End(tag) => {
|
||||||
|
|
@ -599,6 +600,7 @@ where
|
||||||
let tokens = parse_html(&html);
|
let tokens = parse_html(&html);
|
||||||
let mut is_raw = false;
|
let mut is_raw = false;
|
||||||
for token in tokens {
|
for token in tokens {
|
||||||
|
trace!("html token={token:?}");
|
||||||
match token {
|
match token {
|
||||||
Token::DoctypeToken(_) => {}
|
Token::DoctypeToken(_) => {}
|
||||||
Token::TagToken(tag) => {
|
Token::TagToken(tag) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue