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

SQL comments are omitted by the transformers #654

Closed
5 tasks done
senicko opened this issue Apr 14, 2024 · 1 comment · May be fixed by NOUIY/nodejs.org#1340, NOUIY/nodejs.org#1349, NOUIY/nodejs.org#1358, NOUIY/nodejs.org#1367 or NOUIY/nodejs.org#1376

Comments

@senicko
Copy link
Contributor

senicko commented Apr 14, 2024

Validations

Describe the bug

Hello!
I have noticed that -- [!code highlight] notation might not be understood by transformers.

I am testing different features on a blog I am building and I have a SQL code snippet, where -- [!code highlight] does not apply the css class on the line. What's interesting though is that -- // [!code highlight] is working, but it leaves the -- in the snippet, like

image
In the image above the line has the css class (applied by the transformer), but sql comment syntax is not removed.

Is it a bug, or I am just doing something wrong? I have looked at the transformer code, and there is some RegExp in packages/transformers/src/transformers/notation-map.ts which seems to be matching the comments. Maybe SQL comment syntax is just not there?

Reproduction

Try to apply transformerNotationHighlight on a SQL snippet.

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@senicko
Copy link
Contributor Author

senicko commented Apr 14, 2024

There is a workaround of course, it is possible to just use transformerMetaHighlight.

@antfu antfu closed this as completed in cc13539 Apr 15, 2024
diegohaz referenced this issue in ariakit/ariakit May 14, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [shiki](https://github.com/shikijs/shiki)
([source](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki))
| [`1.3.0` ->
`1.5.1`](https://renovatebot.com/diffs/npm/shiki/1.3.0/1.5.1) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/shiki/1.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/shiki/1.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/shiki/1.3.0/1.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/shiki/1.3.0/1.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>shikijs/shiki (shiki)</summary>

### [`v1.5.1`](https://github.com/shikijs/shiki/releases/tag/v1.5.1)

[Compare
Source](https://github.com/shikijs/shiki/compare/v1.5.0...v1.5.1)

#####    🐞 Bug Fixes

- **core**: Simplify cloudflare wasm loading  -  by
[@&#8203;hi-ogawa](https://github.com/hi-ogawa) in
[https://github.com/shikijs/shiki/issues/670](https://github.com/shikijs/shiki/issues/670)
[<samp>(cd239)</samp>](https://github.com/shikijs/shiki/commit/cd239324)

#####     [View changes on
GitHub](https://github.com/shikijs/shiki/compare/v1.5.0...v1.5.1)

### [`v1.5.0`](https://github.com/shikijs/shiki/releases/tag/v1.5.0)

[Compare
Source](https://github.com/shikijs/shiki/compare/v1.4.0...v1.5.0)

#####    🚀 Features

- Upgrade deps, new langs  -  by
[@&#8203;antfu](https://github.com/antfu)
[<samp>(d5b04)</samp>](https://github.com/shikijs/shiki/commit/d5b04703)

#####     [View changes on
GitHub](https://github.com/shikijs/shiki/compare/v1.4.0...v1.5.0)

### [`v1.4.0`](https://github.com/shikijs/shiki/releases/tag/v1.4.0)

[Compare
Source](https://github.com/shikijs/shiki/compare/v1.3.0...v1.4.0)

#####    🚀 Features

- Upgrade deps, new langs and themes  -  by
[@&#8203;antfu](https://github.com/antfu)
[<samp>(26f37)</samp>](https://github.com/shikijs/shiki/commit/26f37f08)

#####    🐞 Bug Fixes

- **core**: Check existance of `Buffer.isBuffer`, fix
[#&#8203;664](https://github.com/shikijs/shiki/issues/664)  -  by
[@&#8203;NullVoxPopuli](https://github.com/NullVoxPopuli) in
[https://github.com/shikijs/shiki/issues/666](https://github.com/shikijs/shiki/issues/666)
and
[https://github.com/shikijs/shiki/issues/664](https://github.com/shikijs/shiki/issues/664)
[<samp>(86d52)</samp>](https://github.com/shikijs/shiki/commit/86d5271e)
- **monaco**: Options for tokenize limit  -  by
[@&#8203;hddhyq](https://github.com/hddhyq),
[@&#8203;antfu](https://github.com/antfu) and **Anthony Fu** in
[https://github.com/shikijs/shiki/issues/657](https://github.com/shikijs/shiki/issues/657)
[<samp>(a606d)</samp>](https://github.com/shikijs/shiki/commit/a606d449)
- **transformers**: Allow SQL comment syntax in notation transformer,
fix [#&#8203;654](https://github.com/shikijs/shiki/issues/654)  -  by
[@&#8203;senicko](https://github.com/senicko) in
[https://github.com/shikijs/shiki/issues/655](https://github.com/shikijs/shiki/issues/655)
and
[https://github.com/shikijs/shiki/issues/654](https://github.com/shikijs/shiki/issues/654)
[<samp>(cc135)</samp>](https://github.com/shikijs/shiki/commit/cc13539e)

#####     [View changes on
GitHub](https://github.com/shikijs/shiki/compare/v1.3.0...v1.4.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ariakit/ariakit).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM0MC4xMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment