Skip to content

Commit b5b9a04

Browse files
Secrusneersighted
authored andcommitted
Change regex string to less permissive one
1 parent 9ebf24f commit b5b9a04

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cleo/ui/table.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ def _render_cell(self, row: Row, column: int, cell_format: str) -> str:
376376
pad = style.pad
377377
if isinstance(cell, TableCell) and isinstance(cell.style, TableCellStyle):
378378
is_not_styled_by_tag = not re.match(
379-
r"^<(\w+|(\w+=[\w,]+;?)*)>.+</(\w+|(\w+=\w+;?)*)?>$", str(cell)
379+
(
380+
r"^<(\w+|((?:fg|bg|options)=[\w,]+;?)+)>"
381+
r".+<\/(\w+|((?:fg|bg|options)=[\w,]+;?)+)?>$"
382+
),
383+
str(cell),
380384
)
381385
if is_not_styled_by_tag:
382386
cell_format = (

0 commit comments

Comments
 (0)