Skip to content

Commit

Permalink
revert dsl object links
Browse files Browse the repository at this point in the history
  • Loading branch information
ccpizz authored and ilius committed Nov 19, 2023
1 parent ecd7afc commit d5f7d25
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pyglossary/plugins/dsl/lex.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,13 @@ def lexS(tr: TransformerType) -> tuple[LexType, ErrorType]:

_, ext = splitext(fname)
ext = ext.lstrip(".")
if ext in ("wav", "mp3", "ogg"):
if ext in ("wav", "mp3"):
if tr.audio:
tr.output += (
f'<a href="{fname}" style="cursor:pointer" '
'onclick="new Audio(this.href).play(); return false;">&nbsp;&#x1F508;</a>'
rf'<object type="audio/x-wav" data="{fname}" '
"width=\"40\" height=\"40\">"
"<param name=\"autoplay\" value=\"false\" />"
"</object>"
)
elif ext in ("jpg", "jpeg", "gif", "tif", "tiff", "png", "bmp"):
tr.output += rf'<img align="top" src="{fname}" alt="{fname}" />'
Expand Down

0 comments on commit d5f7d25

Please sign in to comment.