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

Line numbers in code blocks #1573

Open
NotTheDr01ds opened this issue Oct 1, 2024 · 0 comments
Open

Line numbers in code blocks #1573

NotTheDr01ds opened this issue Oct 1, 2024 · 0 comments

Comments

@NotTheDr01ds
Copy link
Contributor

Our current config for Vuepress is set for lineNumbers: false in the config.

But that's not working, which looks pretty odd in some cases, primarily one-liners:

image

I think there are two reasons that line numbers aren't currently disabled:

  1. First, when we switched to Shiki, the configuration option for turning off line numbers changed, and it wasn't updated in the config.

  2. But more importantly, it looks like there's an upstream problem where the line number setting for the Shiki plugin is completely broken. Attempting to set lineNumbers: false or lineNumbers: disabled, even in the Shiki plugin options, results in line numbers for everything except the last line of a code block.

    I've even tested this in a fresh Vuepress site unrelated to Nushell:

    image

    Of course, this appears to be an upstream issue, but I'm surprised something so fundamental could be

    There's also an option to only turn on line-numbers when the code-block is more than x lines, but that is just as broken.

    I'm wondering if there's a conflict between prismjs and Shiki, since the code-blocks (even on our site) still show both a div with a prismjs attribute and a separate pre block with a shiki attribute.

Anyway - If anyone knows what is going on here, feel free to chime in.

In the meantime, I'll look at other options, such as disabling for each block (still works) or doing it with custom CSS rules.

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

No branches or pull requests

1 participant