-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Fix the handling of tabs in quickinfo Markdown code blocks #95109
Fix the handling of tabs in quickinfo Markdown code blocks #95109
Conversation
Unfortunately I think I need to recommend against my own PR. I just found out that the file For the used library there exists an issue addressing this problem. The tabs are replaced by spaces, because the code apparently cannot handle tab indentation in some cases. I did a quick test and it seems tab indentation screws up nested lists. I couldn't see any other issues, though. So maybe there should be a switch in the settings for this with the two options:
For the user to choose from. Preferably, markdown-it looks like a much better thought-through library. I mean, marked.js didn't bother fixing this issue for almost five years. Also, wouldn't it be smart to use the same parser for both the quick info boxes and the Markdown preview? Apparently, the library used for the Markdown preview does not replace tabs so it's likely not marked.js. |
Thanks for investigating. I agree that Is there some way to scope your fix just to code blocks? |
Well, the replacement is just a dumb in all the code, replace a character command with no further context information. I thought of maybe another fix. Apart from the one informational issue that tab characters get replaced by space characters I'd say the major problem are the visual issues:
As long as the resulting length is 4 I personally do not care about 1. to be honest. I use them to align mid-text, though. apple red
banana yellow
lime green So I am thinking about a fix for 2. I could replace the few calls to apple red
banana yellow
lime green Currently, this would be the result: apple red
banana yellow
lime green Why is this important for me? I haven't posted anything about it, yet, and I don't know how open you are for introducing new settings to VS Code, but I was thinking about a new setting allowing users to decide whether they want their quick infos with |
I'm going to close this PR as it is out of date and the corresponding issue has not seen any further interest since it was opened |
This PR fixes #95096
This alters the behavior of Markdown parsed from JSDoc documentation comments and its appearance in the IntelliSense quickinfo boxes on mouseover. Previously, tabs were replaced by four spaces each. I don't know, why. Also, I set the tab size to 4 for code blocks in the quickinfo box. Testing instructions are in the issue thread.