From 818bb287793f09db3d31192e3bfd1f9f0e772dae Mon Sep 17 00:00:00 2001 From: Leynos Date: Sun, 15 Jun 2025 10:37:30 +0100 Subject: [PATCH 1/2] Add uppercase HTML table test --- tests/integration.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index b54b8edb..5dd145f9 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -426,6 +426,12 @@ fn test_convert_html_table_with_attrs_basic() { assert_eq!(convert_html_tables(&html_table_with_attrs()), expected); } +#[test] +fn test_convert_html_table_uppercase() { + let expected = vec!["| A | B |", "| --- | --- |", "| 1 | 2 |"]; + assert_eq!(convert_html_tables(&html_table_uppercase()), expected); +} + #[test] fn test_convert_html_table_with_colspan() { let expected = vec!["| A |", "| --- |", "| 1 | 2 |"]; From b3c32e184b96a651e26a789d55ea87a151c72c6b Mon Sep 17 00:00:00 2001 From: Leynos Date: Sun, 15 Jun 2025 10:57:34 +0100 Subject: [PATCH 2/2] Document case-insensitive table regex --- src/html.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/html.rs b/src/html.rs index f853ed5b..353945be 100644 --- a/src/html.rs +++ b/src/html.rs @@ -14,8 +14,10 @@ use std::sync::LazyLock; use crate::is_fence; +/// Matches the start of an HTML `` tag, ignoring case. static TABLE_START_RE: LazyLock = LazyLock::new(|| Regex::new(r"(?i)^|$)").unwrap()); +/// Matches the end of an HTML `
` tag, ignoring case. static TABLE_END_RE: LazyLock = LazyLock::new(|| Regex::new(r"(?i)").unwrap()); /// Extracts the text content of a DOM node, collapsing consecutive