From 67f5ee4f8d766d3f2b1f05d8b5b88f3ccfcff8cc Mon Sep 17 00:00:00 2001 From: Bartek Sokorski Date: Sun, 20 Nov 2022 19:15:23 +0100 Subject: [PATCH] Change regex string to less permissive one --- src/cleo/ui/table.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cleo/ui/table.py b/src/cleo/ui/table.py index cf3cc238..accaf547 100644 --- a/src/cleo/ui/table.py +++ b/src/cleo/ui/table.py @@ -376,7 +376,11 @@ def _render_cell(self, row: Row, column: int, cell_format: str) -> str: pad = style.pad if isinstance(cell, TableCell) and isinstance(cell.style, TableCellStyle): is_not_styled_by_tag = not re.match( - r"^<(\w+|(\w+=[\w,]+;?)*)>.+$", str(cell) + ( + r"^<(\w+|((?:fg|bg|options)=[\w,]+;?)+)>" + r".+<\/(\w+|((?:fg|bg|options)=[\w,]+;?)+)?>$" + ), + str(cell), ) if is_not_styled_by_tag: cell_format = (