Don't set a label if there is none
This commit is contained in:
parent
3c8456cda3
commit
6e383b8980
1 changed files with 3 additions and 2 deletions
|
@ -138,8 +138,9 @@ class GemParser:
|
|||
# This is a pre start tag
|
||||
if starts_with_pre and self.mstate != StateEnum.PRETEXT:
|
||||
self.mstate = StateEnum.PRETEXT
|
||||
rstring += self.get_start_tag().format(' aria-label="{}"'.format(
|
||||
line[4:].rstrip('\n')))
|
||||
label: str = line[4:].rstrip('\n').strip()
|
||||
rstring += self.get_start_tag().format(
|
||||
' aria-label="{}"'.format(label) if label else '')
|
||||
return rstring
|
||||
# This is in pre formatted text
|
||||
elif self.mstate == StateEnum.PRETEXT and not starts_with_pre:
|
||||
|
|
Loading…
Add table
Reference in a new issue