Skip to content

Commit

Permalink
display images in browser when paging, even when they are only media …
Browse files Browse the repository at this point in the history
…attachments & not part of content
  • Loading branch information
enkiv2 committed Jun 26, 2019
1 parent 5c0110d commit cb55138
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fern
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,13 @@ def execCommand(cmd):
browser=os.getenv("BROWSER", "")
teardownCurses()
if browser!="":
subprocessRun(browser, "<html><body>"+tl[tlIdx+hlIdx]["content"]+"</body></html>")
attach=""
if "media_attachments" in tl[tlIdx+hlIdx]:
for attachment in tl[tlIdx+hlIdx]["media_attachments"]:
t="embed"
if attachment["type"]=="image": t="img"
attach+="<br><"+t+' src="'+attachment["url"]+'">'
subprocessRun(browser, "<html><body>"+tl[tlIdx+hlIdx]["content"]+attach+"</body></html>")
else:
subprocessRun(pager, processContents(tl[tlIdx+hlIdx]["content"]))
setupCurses()
Expand Down

0 comments on commit cb55138

Please sign in to comment.