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

[Eleventy] line highlighting requires character after the line-specifying } #194

Open
olets opened this issue Jan 4, 2024 · 0 comments
Open

Comments

@olets
Copy link

olets commented Jan 4, 2024

Shiki Twoslash supports highlighting lines. For me in Eleventy (v2.0.1, eleventy-plugin-shiki-twoslash v1.1.3) this only works if I add a space after the }.

I haven't tried other plugins, it may not be specific to the Eleventy package.

Expected

```text {0}
highlighted
not highlighted
```

results in something like

<pre class="shiki">
  <div class="language-id">text</div>
  
  <div class="code-container">
    <code>
      <div class="line highlight">
        highlighted
      </div>
      
      <div class="line">
        not highlighted
      </div>
    </code>
  </div>
</pre>

Actual

```text {0}
highlighted
not highlighted
```

results in something like

<pre class="shiki">
  <div class="language-id">text</div>
  
  <div class="code-container">
    <code>
-      <div class="line highlight">
+      <div class="line">
        highlighted
      </div>
      
      <div class="line">
        not highlighted
      </div>
    </code>
  </div>
</pre>

Workaround

Adding whitespace after the }, like so (looks the same; select to see the text·{0}·

```text {0} 
highlighted
not highlighted
```

results in the highlighted line getting .highlight.

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