microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.65k stars 28.67k forks source link

Workspace markdown.css with file outside of workspace #159933

Closed SomnaW closed 2 years ago

SomnaW commented 2 years ago

Issue Type: Bug

When I open a file in a workspace that does not exist in the workspace, my custom markdown css doesn't work with it. The markdown files I'm having trouble with are generated in the %APPDATA%\Local\Temp folder. I have tried storing a copy of the css in my root user folder and listing a series of ../ options to cover as many levels as it would take, but that did not work. I also tried file:/// to point to that same user root location and the root of the workspace location without success. The only way I can get the styling to work is to copy my workspace's css to the %APPDATA%\Local\Temp folder and leave off any ../ or ./. That isn't a great long term solution and I'd rather have a global css that I can use, with maybe the ability to supplement with workspace based css. Alternately, if you still are against a global css option as I've seen in other tickets, can you get the css in the root of the workspace to work with all files open in that workspace, regardless of where the markdown file is stored? Thank you.

VS Code version: Code 1.69.2 (3b889b090b5ad5793f524b5d1d39fda662b96a2a, 2022-07-18T16:12:52.460Z) OS version: Windows_NT x64 10.0.19044 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-10980HK CPU @ 2.40GHz (16 x 3096)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.76GB (4.18GB free)| |Process Argv|--crash-reporter-id f5da6a8d-ffad-4aa1-b7e5-97c0de28fb38| |Screen Reader|no| |VM|0%|
Extensions (19) Extension|Author (truncated)|Version ---|---|--- npm-intellisense|chr|1.4.2 regex|chr|0.4.0 vscode-eslint|dba|2.2.6 xml|Dot|2.5.1 gitlens|eam|12.2.1 EditorConfig|Edi|0.16.4 vscode-npm-script|eg2|0.3.28 git-project-manager|fel|1.8.2 regexp-preview|Lou|0.1.5 git-graph|mhu|1.30.0 vscode-azurefunctions|ms-|1.7.4 vscode-azureresourcegroups|ms-|0.5.5 csharp|ms-|1.25.0 azure-account|ms-|0.11.1 azurecli|ms-|0.5.0 live-server|ms-|0.4.0 ghosttext|tok|1.1.0 vim|vsc|1.23.2 markdown-all-in-one|yzh|3.4.3
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonvspyt551:30345470 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 wslgetstarted:30449410 cppdebug:30492333 pylanb8912:30545647 vsclangdc:30486549 c4g48928:30535728 hb751961:30553087 dsvsc012cf:30540253 azure-dev_surveyone:30548225 2144e591:30553903 ```
VSCodeTriageBot commented 2 years ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.71.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

SomnaW commented 2 years ago

That did not fix it. This is with the css file existing in the user root and the workspace root. The relevant setting is:

{
    "markdown.styles": [
        "markdown.css",
    ],
}

Version: 1.71.0 (system setup) Commit: 784b0177c56c607789f9638da7b6bf3230d47a8c Date: 2022-09-01T07:36:10.600Z Electron: 19.0.12 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.19044 Sandboxed: No

VSCodeTriageBot commented 2 years ago

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!

mjbvz commented 2 years ago

As you noted, this has already been discussed. We don't allow this for security reasons

SomnaW commented 2 years ago

@mjbvz Perhaps I missed part of the discussion then. I had only seen issues where people were unable to have a global css file. I did not see others discuss being unable to have the workspace css apply to all files open in the workspace. Is this by design as well?