1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! Semantic HTML5 element handlers for HTML to Markdown conversion.
//!
//! This module provides specialized handlers for semantic HTML5 elements:
//! - Sectioning elements (article, section, nav, aside, header, footer, main)
//! - Figure elements (figure, figcaption)
//! - Interactive elements (details, summary, dialog)
//! - Semantic inline attributes (cite, q, abbr, dfn, time, data)
//!
//! These handlers are designed to be extracted from the main `converter.rs`
//! file and integrated through the dispatcher function.
//!
//! **Integration Pattern:**
//! Each handler function takes the same signature:
//! - `tag_name: &str` - The HTML tag being processed
//! - `node_handle: &NodeHandle` - The DOM node handle
//! - `parser: &Parser` - The HTML parser reference
//! - `output: &mut String` - The output buffer to write to
//! - `options: &ConversionOptions` - Conversion configuration
//! - `ctx: &Context` - Processing context (state tracking)
//! - `depth: usize` - Current DOM tree depth
//! - `dom_ctx: &DomContext` - DOM context for tree relationships
//!
//! The main dispatcher function `dispatch_semantic_handler` routes tags to
//! their appropriate handlers and returns a boolean indicating success.
// Re-export types from parent module for submodule access
pub use walk_node;
pub use ;
// Re-export handler functions for direct use
pub use handle as handle_attributes;
pub use handle as handle_definition_list;
pub use handle as handle_figure;
pub use handle as handle_sectioning;
pub use handle as handle_summary;
// Re-exports are done via the dispatch function parameter types
/// Dispatches semantic element handling to the appropriate handler.
///
/// This function routes semantic HTML5 elements to their specialized handlers
/// based on tag name. It is designed to be called from the main `walk_node`
/// function in `converter.rs`.
///
/// # Routing Table
///
/// The following tag routes are supported:
/// - **Sectioning**: article, section, nav, aside, header, footer, main
/// - **Figure**: figure, figcaption
/// - **Summary**: details, summary, dialog
/// - **Definition List**: hgroup, dl, dt, dd, menu
/// - **Attributes**: cite, q, abbr, dfn, time, data
///
/// # Returns
///
/// Returns `true` if the tag was successfully handled by a semantic handler,
/// `false` if the tag is not a semantic element and requires other handling.
///
/// # Example
///
/// ```text
/// if dispatch_semantic_handler(tag_name, &node_handle, &parser, output, options, ctx, depth, dom_ctx) {
/// // Tag was handled
/// } else {
/// // Continue with other handlers
/// }
/// ```