Skip to content

handle img tags in pr/issue view #229

Open

Description

@ampinsk

<img> tags are dropped when rendering issue/pr markdown in the terminal. They should be rendered in the same way as other images.

This is a tricky problem:

  • fixing it within gh requires regexing/parsing HTML on our own which is a brittle solution
  • glamour doesn't want to fix it upstream

but dropping <img> tags without a trace isn't an option for us.

Solving this issue might mean using goldmark directly and doing a spike on what that would give us / lose for us is appropriate.

Activity

  1. added
    enhancement
    on Jan 14, 2020
  2. vilmibm commented on Mar 23, 2020

    @vilmibm
    Contributor

    The switch to glamour added <Image: ...> rendering but still doesn't render <img> tags. will update the description.

  3. changed the title [-]improve image handling in issue/pr preview[/-] [+]handle img tags in pr/issue view[/+] on Mar 23, 2020
  4. added
    core
    on Oct 5, 2020
  5. g14a commented on Apr 1, 2021

    @g14a
    Contributor

    @vilmibm @ampinsk I tried solving this. Issues and PRs look like the following respectively. Does it look okay or can it be better from a design perspective?

    Issues:

    image

    PRs:

    sample

    Do you want to take a look at the PR which fixes this?

  6. g14a commented on Apr 7, 2021

    @g14a
    Contributor

    Do you want to take a look at the PR which fixes this?

    or @mislav ?

  7. g14a commented on May 14, 2021

    @g14a
    Contributor

    @mislav I went ahead and tried fixing this because I was bored #3640. Would love some feedback :)

  8. added
    gh-pr
    gh-issue
    on Oct 2, 2023
  9. en1m4 commented on Feb 25, 2026

    @en1m4
    $ gh issue view 7 --json body
    { 
      "body": "<img width=\"2800\" height=\"1260\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/c060afa6-7f07-4076-8bfa-ac66511caa43\" />"
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreenhancementgh-issuegh-pr

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions