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

show-whitespace is wrong for tabs in markdown because of a GitHub bug #5708

Closed
3 of 4 tasks
fregante opened this issue Jun 20, 2022 · 0 comments · Fixed by #5715
Closed
3 of 4 tasks

show-whitespace is wrong for tabs in markdown because of a GitHub bug #5708

fregante opened this issue Jun 20, 2022 · 0 comments · Fixed by #5715
Assignees
Labels
bug github bug help wanted small Issues that new contributors can pick up

Comments

@fregante
Copy link
Member

fregante commented Jun 20, 2022

Please ensure:

  • The bug is caused by Refined GitHub. It doesn't happen if I disable the extension.
  • The bug happens after clearing extension cache. The "Clear cache" button below can also be found at the bottom of the options page.

Example URLs

Extension version

22.5.22

Browser(s) used

Safari

Description

Custom tab size is broken for me: https://github.com/settings/appearance

Tabs are rendered as 8 spaces even my setting is for 2:

Screen Shot

This is because GitHub isn't adding any data-tab-size attributes in comments for me, even without RGH. I'm only seeing them on embedded code.

And for some reason we default to "4" instead of "8" in our code:

background-size: calc(var(--tab-size, 4) * 1ch) 1.25em;

Demo

Live:

 1 space
	1 tab

Screenshot:
Screen Shot 1

Solution

We have 2 options:

  • set a global default of 4 via non-specific selector: :where(:root) {--tab-size: 4; tab-size: 4}
  • change that default to 8

We should probably do both. The latter can be hotfixed.

Include in this issue:

  • Screenshots/video/gif demonstrating the bug, if it’s visual
  • Console errors, if any
@fregante fregante added bug help wanted small Issues that new contributors can pick up github bug labels Jun 20, 2022
@fregante fregante self-assigned this Jun 22, 2022
fregante added a commit that referenced this issue Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug github bug help wanted small Issues that new contributors can pick up
Development

Successfully merging a pull request may close this issue.

1 participant