shikijs / textmate-grammars-themes

Collection of TextMate grammars and themes in JSON
https://textmate-grammars-themes.netlify.app/
MIT License
116 stars 57 forks source link

fix(grammer): nesting andnative markdown highlighting in MDC grammer #102

Closed farnabaz closed 22 hours ago

farnabaz commented 1 week ago

Change MDC grammer to allow standalone usage. The current state is designed to inject into markdown grammar which is suitable for standalone use like Shiki

Before:

Screenshot 2024-11-14 at 01 07 30

After:

Screenshot 2024-11-14 at 01 09 38

Here is the markdown that you can test with:

---
data: value
---

::Grid{cols="3"}
  :::GridCard{#html-id .some-class}
  ...
  :::

  :::GridCard{#html-id2 .some-class}
  ...
  :::

  :::GridCard{#html-id3 .some-class}
  ---
  icon: information
  ---
  Use Vue components in Markdown files, with props, slots
  and nested components with our improved Markdown syntax.

  #header

  Markdown with Components
  :::
::
netlify[bot] commented 1 week ago

Deploy Preview for textmate-grammars-themes ready!

Name Link
Latest commit ccc3dda9ef2c4b5391c38e916992f51356f56ec2
Latest deploy log https://app.netlify.com/sites/textmate-grammars-themes/deploys/673f760541b5e60008552fe1
Deploy Preview https://deploy-preview-102--textmate-grammars-themes.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

antfu commented 1 week ago

Did you change the source? This is a script that fetch upstream grammar and automatically updates on daily-basis

farnabaz commented 1 week ago

I didn't notice that grammar is updating automatically.

But the thing is we can't use MDC grammar from vscode extension, because as I said, it is designed to inject into VSCode markdown language, and using it as standalone grammar will lead to highlight issues.

I will update vscode-mdc, add another grammar for standalone usage, and update this PR

farnabaz commented 2 days ago

Conflicts have been resolved.