type fixes

This commit is contained in:
Will McGugan 2020-06-26 11:33:53 +01:00
parent 96899fd400
commit b584dd64db
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,6 @@ class Style:
encircle: bool = None,
overline: bool = None,
link: str = None,
link_id: str = None,
):
self._ansi: Optional[str] = None
self._style_definition: Optional[str] = None
@ -150,7 +149,7 @@ class Style:
)
)
self._link = link
self._link_id = (link_id or f"{time()}-{randint(0, 999999)}") if link else ""
self._link_id = f"{time()}-{randint(0, 999999)}" if link else ""
bold = _Bit(0)
dim = _Bit(1)

View File

@ -363,7 +363,8 @@ class Text(JupyterMixin):
if style:
start, end = get_span()
match_style = style(plain[start:end]) if callable(style) else style
append_span(_Span(start, end, match_style))
if match_style is not None:
append_span(_Span(start, end, match_style))
count += 1
for name in match.groupdict().keys():