Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ use std::sync::LazyLock;

use crate::is_fence;

/// Matches the start of an HTML `<table>` tag, ignoring case.
static TABLE_START_RE: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"(?i)^<table(?:\s|>|$)").unwrap());
/// Matches the end of an HTML `</table>` tag, ignoring case.
static TABLE_END_RE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(?i)</table>").unwrap());

/// Extracts the text content of a DOM node, collapsing consecutive
Expand Down
6 changes: 6 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Comment thread
leynos marked this conversation as resolved.

#[test]
fn test_convert_html_table_with_colspan() {
let expected = vec!["| A |", "| --- |", "| 1 | 2 |"];
Expand Down