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

Use VS Code's syntax highlighting in Markdown preview #91279

Open
David-Else opened this issue Feb 24, 2020 · 7 comments
Open

Use VS Code's syntax highlighting in Markdown preview #91279

David-Else opened this issue Feb 24, 2020 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality markdown Markdown support issues
Milestone

Comments

@David-Else
Copy link

Issue Type: Bug

When I use "editor.semanticHighlighting.enabled": true, TypeScript looks great, but now the Markdown code looks bad in comparison. Please see the screenshot.
Screenshot from 2020-02-24 14-31-46

VS Code version: Code 1.42.1 (c47d83b, 2020-02-11T14:50:36.977Z)
OS version: Linux x64 4.18.0-147.5.1.el8_1.x86_64

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4770S CPU @ 3.10GHz (8 x 3681)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 0
Memory (System) 7.50GB (2.44GB free)
Process Argv --no-sandbox --unity-launch /home/david/sites/Link to typing objects cheat-sheet.md
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
vscode-deno axe 2.0.4
spellright ban 3.0.50
vscode-eslint dba 2.1.1
prettier-vscode esb 3.20.0
shell-format fox 7.0.1
debugger-for-chrome msj 4.12.6
LiveServer rit 5.6.1
shellcheck tim 0.9.0
quokka-vscode Wal 1.0.279
@David-Else David-Else changed the title SemanticHighlighting not shown in Markdown preview in TypeScript code Semantic Highlighting not shown in Markdown preview in TypeScript code Feb 24, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 24, 2020

@aeschli The markdown extension needs a command or api to get the semantic highlighting colors in order to support this

@aeschli
Copy link
Contributor

aeschli commented Feb 25, 2020

@mjbvz Assigning back to you as it's a feature request for markdown.
I created #91375 for the missing API to programmatically get semantic tokens.

@aeschli aeschli assigned mjbvz and unassigned aeschli Feb 25, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 25, 2020

See #56356 for api feature request to get colors as they appear in the editor

Try this extension to get closer to VS Code's highlighting (but still without semantic highlighting): https://marketplace.visualstudio.com/items?itemName=bierner.markdown-shiki

@mjbvz mjbvz added the feature-request Request for new features or functionality label Feb 25, 2020
@mjbvz mjbvz added this to the Backlog milestone Feb 25, 2020
@mjbvz mjbvz added the markdown Markdown support issues label Feb 25, 2020
@David-Else
Copy link
Author

@mjbvz I have been looking at bierner.markdown-shiki and it is great. Is there a way I can convert my MD to a PDF with this highlighting you know of? Cheers.

@mjbvz mjbvz changed the title Semantic Highlighting not shown in Markdown preview in TypeScript code Use VS Code's syntax highlighting in Markdown preview Nov 5, 2020
@Nirmal4G
Copy link

I would also request an option to switch between VSCode themes and other standard markdown themes like GitHub's, GitLabs's, NuGet's and other places where they render markdown in their own styling.

@Nirmal4G
Copy link

It would be nice to support diff+language syntax highlighting in Markdown preview too! I can't seem to find any good solutions for this anywhere. If someone had written a tool, please point me to it!

@znorman-harris
Copy link

Another place where this is very apparent: new languages added to VSCode don't have syntax highlighting by default in the markdown preview. Oddly enough, any code blocks added as markdown and displayed via hover help and a language server have the proper color/style to match the editor, but are lacking from the markdown preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality markdown Markdown support issues
Projects
None yet
Development

No branches or pull requests

5 participants