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

Highlighting code blocks: leading spaces should be counted #2573

Open
damithc opened this issue Sep 13, 2024 · 2 comments · May be fixed by #2584
Open

Highlighting code blocks: leading spaces should be counted #2573

damithc opened this issue Sep 13, 2024 · 2 comments · May be fixed by #2584

Comments

@damithc
Copy link
Contributor

damithc commented Sep 13, 2024

Context: I was trying to highlight these leading spaces, but was not able to.
image

Consider the following code:

```{highlight-lines="[:4]"}
  abcd
````

Expected: highlight ab and the two spaces in front
Actual: highlights abcd

So, it seems the current counting doesn't include leading spaces.

@yucheng11122017
Copy link
Contributor

Hi @damithc I think this was the intended behaviour when this feature was introduced in #1478 by @ryoarmanda. Making this correction to include leading spaces would be a breaking change since users would have to adjust their spacing accordingly. Is the use case for this important?

@damithc
Copy link
Contributor Author

damithc commented Dec 17, 2024

Hi @damithc I think this was the intended behaviour when this feature was introduced in #1478 by @ryoarmanda. Making this correction to include leading spaces would be a breaking change since users would have to adjust their spacing accordingly. Is the use case for this important?

@yucheng11122017 Ah, I see. I guess we can look for a way to support the requested behaviour in an non-breaking way, or introduce it as a breaking change together with a major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants