Repository navigation
Conversation
| @@ -0,0 +1,137 @@ | |||
| package glamour | |||
There was a problem hiding this comment.
It looks like these tests are failing on Windows only, and in the glamour repo they are explicitly not running the tests on Windows. Does anyone have an ideas on why these tests are only failing on Windows? My naive guess is that it has to do with carriage returns.
There was a problem hiding this comment.
Haven't looked at test failures, but unless we are going to maintain this internal fork of glamour and its tests (and I suggest that we don't), let's instead delete all the tests and trust the github.com/yuin/goldmark/renderer package instead.
There was a problem hiding this comment.
Thanks for taking this on! It looks like the goldmark-emoji plugin parses emoji correctly, but does the glamour terminal renderer actually render those emoji visibly? That is not my experience if I build this branch and run:
gh repo view muan/emoji
I can see that numerous emoji such as :heart: in the repo's README are simply swallowed— nothing is being rendered.
| @@ -0,0 +1,245 @@ | |||
| package glamour | |||
There was a problem hiding this comment.
Instead of copying over the whole glamour.go intact, since we don't need most of these APIs (and since they were not enough for us to inject emoji handling), we could try trimming down this file to a bare minimum that allows us to render GitHub-flavored markdown. I imagine that most of what this file would be doing is interfacing with github.com/yuin/goldmark/renderer.
| @@ -0,0 +1,137 @@ | |||
| package glamour | |||
There was a problem hiding this comment.
Haven't looked at test failures, but unless we are going to maintain this internal fork of glamour and its tests (and I suggest that we don't), let's instead delete all the tests and trust the github.com/yuin/goldmark/renderer package instead.
| "github.com/cli/cli/internal/glamour" | ||
| ) | ||
|
|
||
| func Render(text, style string, baseURL string) (string, error) { |
There was a problem hiding this comment.
For the sake of minimal diff, I would suggest that this method stays the same as before.
I don't see value in splitting it into several RenderWith* methods, especially since that required changing all the current call sites, but there was no gain in functionality. We pass down all the same arguments (style and base URL) like before, and we hardcode the wrap margin to 80 like before.
In the future we can expose setting wrap margin to something else other than 80 (ideally the width of the user's terminal), but let's do that in a separate PR rather than in the one that is about emoji.
|
Going to close this PR as I have opened a PR to add emoji support directly to |
This PR does a couple things:
RenderWithfunctions to handle rendering customizationcloses #2352