language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Prisma syntax highlighting not active in Markdown preview (VSCode)

Open AjaniBilby opened this issue 1 year ago • 4 comments

Bug description

Syntax highlighting for Prisma in Markdown documents in VSCode only highlighting in editor and not in preview

How to reproduce

## Database layout

\```prisma
model Thing {
	id Int @id @default(autoincrement())
}
\```

image

Note: I did also try disabling my other markdown extensions such as the Github theming one to see if they were interfering and they are not. I would like to be able to use Prisma notation for documentation :heart:

Expected behavior

The syntax highlighting present in the syntax highlighted markdown should also be present in the markdown preview.

Environment & setup

  • OS: Microsoft Windows [Version 10.0.22621.1555] (Win 11)
  • Editor: VSCode
  • Editor version: 1.77.3
  • Extension version: Prisma v4.12.0

AjaniBilby avatar Apr 14 '23 05:04 AjaniBilby

Hi @AjaniBilby !

I think this is because VS Code uses highlight.js for the markdown preview and Prisma is not supported there yet: https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md

So it looks like someone would need to check how to add support for Prisma in highlightjs one day.

Jolg42 avatar Apr 26 '23 08:04 Jolg42

That's a good point, it's a shame we can't have a standard for representing syntax highlighting... If you want highlighting in an IDE, use textmate's standard, prebuilt documentation is often pygments, but if you want dynamic highlighting in the web then it's highlight.js's...

AjaniBilby avatar Apr 26 '23 08:04 AjaniBilby

Yes... 🙈 It's complicated and requires a lot of knowledge & work when a project introduces a new syntax to be supported everywhere!

Jolg42 avatar Apr 26 '23 08:04 Jolg42

Linking the issue about highlightjs https://github.com/prisma/prisma/issues/2337

Jolg42 avatar Apr 26 '23 08:04 Jolg42