mjbvz / vscode-markdown-shiki

Uses Shiki for VS Code's built-in markdown preview syntax highlighting
https://marketplace.visualstudio.com/items?itemName=bierner.markdown-Shiki
MIT License
19 stars 6 forks source link

Code color(not colored) sets to editor.foreground instead of #000000 #18

Open huacat1017 opened 1 year ago

huacat1017 commented 1 year ago

Steps to reproduce:

  1. Install C/C++ Themes and use the theme
  2. Install Markdown Preview VS Code Highlighting
  3. Create a new Markdown file and type these:
    ```bash
    sh build.sh p3
    #include <iostream>
    using namespace std;
    int main(){
    cout << "Hello World";
    }
  4. Can't see some texts because the color is #000000 螢幕擷取畫面 2023-06-13 164653

I studied about this months ago. In my opinion, if the theme developers don't specify this below in their json theme file:

"tokenColors":[
  {
    "name": "Global settings",
    "settings": {
      "foreground": "#ffffff" // If they specify it with editor.foreground hex code, the black texts will change back to the properly color that matches the bg color.
    }
  }
]

, the texts that they don't color through the TextMate's Scopes will stay #000000 even if it is a dark theme. And it's almost unable for me to read. You can see more clearly through this picture: (Theme: Github Dark in Github Theme)

螢幕擷取畫面 2023-06-13 165920

I wonder if there's a way to replace the foreground in TextMate token colors with editor.foreground the theme developer specified when the program reads the json file of the theme. I'm bad at JS/TS, so I would ask you if you can fix this. Thank you for reading this!

piscopancer commented 2 months ago

any updates on this issue? this behavior is clearly a bug and I ran into it too

image