charmbracelet / glamour

Stylesheet-based markdown rendering for your CLI apps 💇🏻‍♀️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrapped hyperlinks are broken

EricAndrechek opened this issue · comments

When a link that is too long is passed into glow, the resulting link breaks into a new line, which in turn breaks the link. For example, this link, when clicked, takes me to https://github.com/ValveSoftware/steam-for- which is the part of the link on its own line:
image

Making the wrap length extremely long causes the URL to wrap on its own and then still functions as a valid link:
image

Another fix for this, which I believe better matches the markdown hyperlink style, would be to implement something like the escape code method proposed in charmbracelet/glow#237. This method also survives when going through a line break/text wrap:
image

Upon closer examination, it appears this issue is within glamour, not glow, and has been identified already. I did some further digging into fixing things and solving it potentially with json styling, but unfortunately this doesn't work. I believe this issue should be moved to glamour. It is similar to glamour#114 although that is a feature request for anchor style hyperlinks, while this pertains more to the github cli issue in that a forced text wrap by glamour breaks links.