shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.06k stars 51 forks source link

fix: completion result closing tag #179

Closed tmm closed 1 year ago

tmm commented 1 year ago

Fixes closing tag for completion result.


Got the following error while using with Vitepress:

Element is missing end tag

With this code:

```ts twoslash
// @noErrors
console.e
//       ^|

And inspecting the generated code (below), lead me to the syntax error.

```html
<pre class="shiki vitesse-dark twoslash lsp" style="background-color: #121212; color: #dbd7ca"><div class="language-id">ts</div><div class='code-container'><code><div class='line'><span style="color: #B8A965"><data-lsp lsp='var console: Console' >console</data-lsp></span><span style="color: #858585">.</span><span style="color: #B8A965"><data-lsp lsp='any' >e</data-lsp></span></div><div class='meta-line'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class='inline-completions'><ul class='dropdown'><li class=''><span><span class='result-found'>e</span>rror<span></li></ul></span></div></code><a class='playground-link' href='https://www.typescriptlang.org/play/#code/PTAEAEDsHsFECd7XgZwFAGNqRdANgKYB0BaIoFloAegD5A'>Try</a></div></pre>
changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 7777f351ab1bdbb5da2fed3b974bd56992db4b23

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages | Name | Type | | -------------------------------- | ----- | | shiki-twoslash | Patch | | eleventy-plugin-shiki-twoslash | Patch | | markdown-it-shiki-twoslash | Patch | | remark-shiki-twoslash | Patch | | docusaurus-preset-shiki-twoslash | Patch | | gatsby-remark-shiki-twoslash | Patch | | hexo-shiki-twoslash | Patch | | twoslash-cli | Patch | | vuepress-plugin-shiki-twoslash | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

orta commented 1 year ago

Oh yeah, great catch!

tmm commented 1 year ago

No problem! Cool to merge in?

orta commented 1 year ago

Yes, oops, was waiting on CI maybe? no idea

tmm commented 1 year ago

@orta mind doing a release for this changeset?

orta commented 1 year ago

Should be deploying now