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

代码高亮渲染异常 #4546

Open
4 tasks done
Tdahuyou opened this issue Feb 6, 2025 · 1 comment
Open
4 tasks done

代码高亮渲染异常 #4546

Tdahuyou opened this issue Feb 6, 2025 · 1 comment
Labels
upstream Related to the dependencies

Comments

@Tdahuyou
Copy link

Tdahuyou commented Feb 6, 2025

Describe the bug

eg.

export default {
  data () {
    return {
      msg1: '1 Highlighted!' // [!code highlight]
      msg2: '2 Highlighted!' // [!code highlight]
      msg3: '3 Highlighted!' // [!code highlight]
    }
  }
}
export default {
  data () {
    return {
      // msg1: '1 Highlighted!' // [!code highlight]
      // msg2: '2 Highlighted!' // [!code highlight]
      // msg3: '3 Highlighted!' // [!code highlight]
    }
  }
}
Image

Reproduction

{
"devDependencies": {
"vitepress": "2.0.0-alpha.2"
},
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
}
}

Expected behavior

在被注释的代码行后面添加 // [!code highlight] 高亮的位置错误。

export default {
  data () {
    return {
      // msg1: '1 Highlighted!' // [!code highlight]
    }
  }
}
Image

System Info

Chrome: 132.0.6834.160

Additional context

No response

Validations

@Tdahuyou Tdahuyou added the bug: pending triage Maybe a bug, waiting for confirmation label Feb 6, 2025
@brc-dd
Copy link
Member

brc-dd commented Feb 6, 2025

Please create an issue at https://github.com/shikijs/shiki. This was reported to us on our Discord earlier too. Seems like this is a possible workaround but looks very unintuitive to write:

```js-vue
export default {
  data () {
    return {
      {{''}}// msg1: '1 Highlighted!' [!code highlight]
    }
  }
}
```

@brc-dd brc-dd added upstream Related to the dependencies and removed bug: pending triage Maybe a bug, waiting for confirmation labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Related to the dependencies
Projects
None yet
Development

No branches or pull requests

2 participants