Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped hyperlinks are broken #149

Open
EricAndrechek opened this issue May 16, 2022 · 3 comments
Open

Wrapped hyperlinks are broken #149

EricAndrechek opened this issue May 16, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@EricAndrechek
Copy link

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

@EricAndrechek
Copy link
Author

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.

@muesli muesli transferred this issue from charmbracelet/glow May 17, 2022
@muesli muesli added the bug Something isn't working label Oct 12, 2022
@caarlos0
Copy link
Member

fwiw, the main issue isn't even the long description, but a URL > width, e.g.:

[a](http://example.com/with-a-big-path/likely-to-use-more-than-one-line?why-not=after-all-why-not-use-queryparams-too&abc=123)

will render:

CleanShot 2024-07-16 at 14 51 49@2x

caarlos0 added a commit that referenced this issue Jul 16, 2024
@caarlos0
Copy link
Member

caarlos0 commented Jul 17, 2024

unfortunately not sure if we can do something about this :/

caarlos0 added a commit that referenced this issue Jul 25, 2024
* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* wip

* wip

* wip

* fix: autolink

closes #290

* fix: escape characters

closes #106
closes #274
closes #311

* fix: table

* ci: golangci lint update

* feat: use x/golden

* test: #106

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #290

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #312

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #257

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #149

* fix: #239

* feat: use lipgloss table

closes #262

Co-authored-by: bashbunni <bunni@bashbunni.dev>

* fix: codespan is not a block

* test: #315

* test: #316

* fix: #316

* test: table

* fix: codespans, tables

* test: table

* test: #117

* test: #60

* fix: rm stylewriter

* fix: #313

* fix: margin

* fix: blocks and word wrap

* fix: build

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* chore: gitattributes

* fix: test opt

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: stable lipgloss

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: double styles

* fix: tables

* fix: tables

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: bashbunni <bunni@bashbunni.dev>
bashbunni added a commit that referenced this issue Jul 31, 2024
* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* wip

* wip

* wip

* fix: autolink

closes #290

* fix: escape characters

closes #106
closes #274
closes #311

* fix: table

* ci: golangci lint update

* feat: use x/golden

* test: #106

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #290

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #312

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #257

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: #149

* fix: #239

* feat: use lipgloss table

closes #262

Co-authored-by: bashbunni <bunni@bashbunni.dev>

* fix: codespan is not a block

* test: #315

* test: #316

* fix: #316

* test: table

* fix: codespans, tables

* test: table

* test: #117

* test: #60

* fix: rm stylewriter

* fix: #313

* fix: margin

* fix: blocks and word wrap

* fix: build

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* chore: gitattributes

* fix: test opt

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: stable lipgloss

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: double styles

* fix: tables

* fix: tables

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: bashbunni <bunni@bashbunni.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants