-
Notifications
You must be signed in to change notification settings - Fork 29
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
regression: no more diff coloration #211
Comments
Just guessing from where things regressed, but it's probably just that the new default light theme doesn't support highlighting diffs correctly (which isn't surprising because the themes embedded with We have access to a lot more themes through |
Good to know, i'll take a look at it when possible. I thought of the theme support too but the colored |
I did a little bit of research on that today, I can confirm this simply comes from I think we should switch to using Do you remember why you switched to |
We originally switched away from a light/dark variant theme due to the light theme having very low-contrast colors (Base16Mocha IIRC) I picked inspiredgithub since it seemed to have much better contrast, but that was before we added |
#219 exposes a lot more themes if you want to take a look at those too Also worth noting that it looks like a lot of themes mess up that diff highlighting, but we can always patch individual themes to fix little issues like that (depending on how hard that ends up being) |
I already tried those by changing the code directly (see my comparing screenshot), tried again and monokai is definitely the best imo.
We could also fix this upstream, currently it's an issue in |
Ah apologies, that does make more sense now. I agree that monokai is likely the best (although I do really like
I agree, patching upstream is the path of least resistance in the long run. Also worth noting that I'd like to start adding tests for individual themes+syntax highlighting within |
True, they do look good too. The darker background on light theme helps a lot. Let's go for that.
Yeah that would be a good idea. Just looking at the example you provided in the readme, looks like this could be easily tested with insta. |
So I've played around with the values of the github theme, there is actually nothing to patch as the style is present (e.g. markup.deleted) and even works perfectly. Long story short I ended up using a color pick on the letters of a diff and ... yeah it's the right color, it's just so close to black it's hard to see. The actual problem is that the github theme uses background color for diffs, and with them it would be way easier to see the colors. |
(The good news is that means a lot of the foundational work is already supported. I can elaborate more after I get off of work) |
Alright, so the good news is that the background color for the individual lines is already included in the HTML that ```diff
+ Ins
- Del
``` gives us <pre style="background-color:#ffffff;"><code class="language-diff"><span style="background-color:#ddffdd;color:#003300;">+ Ins
</span><span style="background-color:#ffdddd;color:#770000;">- Del
</span></code></pre> and we already support parsing that, so we just need to add an arm for That gets all of the easy stuff out of the way which finally leaves the hard parts of
|
I've gone ahead and merged #219, so we can handle switching the default dark/light syntax highlighting theme if you think there's still enough reason to do so (beyond the bug with inlyne not supporting background color on spans) |
If we can fix the background color in code blocks and the diff/colors looks ok, then there should be no reason to change the default theme. I've quickly looked at supporting that, I think I can do it I just couldn't really find where the background color was actually drawn. |
In inlyne 0.3.3,
```diff
were rendered as follow (the whole line colored).With inlyne main,
```diff
renders as follow (only+
colored).After more research, it looks like commit 04ef6e1 introduced this behavior.
I can probably take a look at that but not in the immediate future.
The text was updated successfully, but these errors were encountered: