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
//! Form element handlers for HTML to Markdown conversion.
//!
//! This module provides specialized handlers for HTML form elements:
//! - Container elements (form, fieldset, legend, label)
//! - Input elements (input, textarea, select, option, optgroup, button)
//! - Measurement elements (progress, meter, output, datalist)
//!
//! 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_form_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 function for direct use
pub use handle as handle_form_elements;
// Re-exports are done via the dispatch function parameter types
/// Dispatches form element handling to the appropriate handler.
///
/// This function routes form-related HTML 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:
/// - **Containers**: form, fieldset, legend, label
/// - **Inputs**: input, textarea, select, option, optgroup, button
/// - **Measurements**: progress, meter, output, datalist
///
/// # Returns
///
/// Returns `true` if the tag was successfully handled by a form handler,
/// `false` if the tag is not a form element and requires other handling.
///
/// # Example
///
/// ```text
/// if dispatch_form_handler(tag_name, &node_handle, &parser, output, options, ctx, depth, dom_ctx) {
/// // Tag was handled
/// } else {
/// // Continue with other handlers
/// }
/// ```