diff options
| author | levlam <levlam@telegram.org> | 2026-07-07 19:21:23 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2026-07-07 19:21:23 +0300 |
| commit | deb31c4917ec486d0b41d5c45f9973d3e397c8a7 (patch) | |
| tree | ac51b0233020dd324e2d2307771dda1798f463c1 | |
| parent | 3e54a20437d2682ca1a5d91a2d68c0a929c214fc (diff) | |
Improve colspan/rowspan handling.
| -rw-r--r-- | td/telegram/WebPageBlock.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/td/telegram/WebPageBlock.cpp b/td/telegram/WebPageBlock.cpp index 39f906ec5..dcd8e6f06 100644 --- a/td/telegram/WebPageBlock.cpp +++ b/td/telegram/WebPageBlock.cpp @@ -825,16 +825,16 @@ class WebPageBlockTableCell { if (cell == nullptr) { return Status::Error(400, "Table cell must be non-empty"); } - if (cell->colspan_ <= 0) { + if (cell->colspan_ < 0) { return Status::Error(400, "Invalid table cell colspan specified"); } - if (cell->rowspan_ <= 0) { + if (cell->rowspan_ < 0) { return Status::Error(400, "Invalid table cell rowspan specified"); } TRY_RESULT_ASSIGN(result.text, RichText::get_rich_text(td, std::move(cell->text_))); result.is_header = cell->is_header_; - result.colspan = cell->colspan_; - result.rowspan = cell->rowspan_; + result.colspan = max(cell->colspan_, 1); + result.rowspan = max(cell->rowspan_, 1); if (cell->align_ == nullptr) { result.align_left = true; } else { |
