@@ -2,7 +2,7 @@ pub use crate::ast::*;
22use crate :: options:: Opts ;
33use crate :: util:: Env ;
44use crate :: Result ;
5- use pulldown_cmark:: { Event , Parser , Tag , HeadingLevel , CodeBlockKind , Options } ;
5+ use pulldown_cmark:: { Event , Parser , Tag , TagEnd , HeadingLevel , CodeBlockKind , Options } ;
66use std:: collections:: HashMap ;
77
88pub struct MarkdownReader { }
@@ -66,11 +66,11 @@ impl MarkdownReader {
6666 let element = match tag {
6767 Tag :: Paragraph => Element :: Paragraph ,
6868
69- Tag :: Heading ( level, _ , _ ) => Element :: Title {
69+ Tag :: Heading { level, .. } => Element :: Title {
7070 level : Self :: heading_level_to_u32 ( level) ,
7171 } ,
7272
73- Tag :: BlockQuote => Element :: TypedBlock {
73+ Tag :: BlockQuote ( _ ) => Element :: TypedBlock {
7474 kind : BlockType :: Quote ,
7575 } ,
7676
@@ -199,7 +199,7 @@ impl MarkdownReader {
199199 continue ;
200200 }
201201
202- Tag :: Link ( _link_type , dest_url, title) => {
202+ Tag :: Link { dest_url, title, .. } => {
203203 let dest_str = dest_url. to_string ( ) ;
204204 let title_str = title. to_string ( ) ;
205205
@@ -243,7 +243,7 @@ impl MarkdownReader {
243243 continue ;
244244 }
245245
246- Tag :: Image ( _link_type , dest_url, title) => {
246+ Tag :: Image { dest_url, title, .. } => {
247247 let dest_str = dest_url. to_string ( ) ;
248248 let title_str = title. to_string ( ) ;
249249
@@ -277,6 +277,13 @@ impl MarkdownReader {
277277 continue ;
278278 }
279279
280+ Tag :: HtmlBlock => {
281+ // HTML blocks will have their content collected via Event::Html
282+ Element :: TypedBlock {
283+ kind : BlockType :: Passtrough ,
284+ }
285+ }
286+
280287 _ => {
281288 // For unsupported tags, create a generic element
282289 Element :: Text
@@ -303,7 +310,7 @@ impl MarkdownReader {
303310
304311 Event :: End ( tag) => {
305312 match tag {
306- Tag :: CodeBlock ( _ ) => {
313+ TagEnd :: CodeBlock => {
307314 // For code blocks, the content is in current_text
308315 if let Some ( mut elem) = stack. pop ( ) {
309316 elem. attributes . push ( Attribute {
@@ -400,7 +407,7 @@ impl MarkdownReader {
400407 }
401408 }
402409
403- Event :: Html ( html) => {
410+ Event :: Html ( html) | Event :: InlineHtml ( html ) => {
404411 // Treat HTML as passthrough content
405412 let ( start_line, start_col) = Self :: byte_offset_to_position ( input, range. start ) ;
406413 let ( end_line, end_col) = Self :: byte_offset_to_position ( input, range. end ) ;
0 commit comments