Skip to content

Outline view + Markdown: Do not display the "#"s #53992

Description

@ssilva

The Outline view for Markdown already displays headers and sub-headers in a structured way; there is no need to pollute the view with "#"s to show the header levels.

image

Activity

  1. added
    markdown-ext
    on Jul 10, 2018
  2. stone-zeng commented on Jul 17, 2018

    @stone-zeng

    It would be better to use different icons (not only "[abc]") to show different header levels.

  3. added
    feature-request
    on Sep 11, 2018
  4. odonyde commented on Jun 6, 2019

    @odonyde

    I support this feature request: Displaying markdown hashes in the outline view is not only redundant (the tree structure already holds this information), but also distracts from the actual content (the section title).

  5. StefanoCecere commented on Dec 17, 2019

    @StefanoCecere

    we need a custom outline view just for markdown files

  6. ckosmowski commented on Jan 24, 2020

    @ckosmowski

    It seems like this was done totally on purpose. Since i cannot estimate the side effects besides the display in the outline i won't file a merge request. But i think we could just remove getSymbolName and replace it with entry.text in two places here:

    private toSymbolInformation(entry: TocEntry): vscode.SymbolInformation {
    return new vscode.SymbolInformation(
    this.getSymbolName(entry),
    vscode.SymbolKind.String,
    '',
    entry.location);
    }
    private toDocumentSymbol(entry: TocEntry) {
    return new vscode.DocumentSymbol(
    this.getSymbolName(entry),
    '',
    vscode.SymbolKind.String,
    entry.location.range,
    entry.location.range);
    }
    private getSymbolName(entry: TocEntry): string {
    return '#'.repeat(entry.level) + ' ' + entry.text;
    }

    and then getSymbolName is also obsolete.

  7. pisces312 commented on Jan 4, 2021

    @pisces312

    I changed the getSymbolName function in resources\app\extensions\markdown-language-features\dist\extension.js to remove '#' char as a workaround.

    getSymbolName(e){return" ".repeat(e.level)+e.text}
  8. ZenaMel commented on Jul 15, 2021

    @ZenaMel

    pisces312 answer should at least be implemented as a config option.

    Here's a visual comparison showing how much more "clutter" the unnecessary #'s create:

    image

    image

  9. added this to the Backlog milestone on Oct 7, 2021
  10. yyangdid commented on Dec 11, 2021

    @yyangdid

    I also don't like the '# with outline, and I also don't want change the native source code file with VSCode or extensions .

    So, I temporarily use Emoji to better distinguish the headers level, this:

    Snipaste_2021-12-11_13-58-21

    And, I really want an option to hidden # 😁

  11. vancejc-mt commented on Aug 17, 2022

    @vancejc-mt

    Just ran across this - I wholeheartedly agree that this should be at least a setting; the hash chars don't add anything the indentation doesn't already address.

  12. Herman-Wu commented on Sep 27, 2022

    @Herman-Wu

    extension.js no longer has the getSymbolName function. Is there anyone who knows other way to remove the annoy "#"? pisces312 , @koffeeboi , Christian Kosmowski (@ckosmowski)

  13. 7 remaining items

  14. AlbertoFabbri93 commented on Jul 15, 2023

    @AlbertoFabbri93

    I agree that the hash chars add unnecessary clutter to the outline view. It would be awesome to have a setting for this

  15. nonplayer commented on Dec 26, 2023

    @nonplayer

    This is especially frustrating as a Portable Mode user. Having to go in and manually make this change every time I upgrade VSCode is a chore.

  16. nonplayer commented on May 9, 2024

    @nonplayer

    May 2024 and this is still an issue with VSCode 1.89.0. Seems the function has again changed names. It's no longer #getTocSymbolName(e) now it's just #se(e) - ignoring the function name, just searching the workerMain.js file for:

    {return"#".repeat(e.level)+" "+e.text}
    

    and replacing it with:

    {return" ".repeat(e.level)+e.text}
    

    still applies the fix.

  17. jim0203 commented on Aug 15, 2024

    @jim0203

    I'm using 1.92.1 on macOS. What would be the path and file that is equivalent to resources\app\extensions\markdown-language-features\server\dist\node\workerMain.js?

    I've found this path:

    /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist

    Which contains a serverWorkerMain.js file. That file includes the text that N. Phillip Cole (@nonplayer) says should be replaced, but replacing it doesn't fix the issue.

    Do I need to do something else (beyond restarting VSCode) to get the change to register? Or am I editing the wrong file?

  18. nonplayer commented on Aug 15, 2024

    @nonplayer

    I'm using 1.92.1 on macOS. What would be the path and file that is equivalent to resources\app\extensions\markdown-language-features\server\dist\node\workerMain.js?

    I've found this path:

    /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist

    Which contains a serverWorkerMain.js file. That file includes the text that N. Phillip Cole (@nonplayer) says should be replaced, but replacing it doesn't fix the issue.

    Do I need to do something else (beyond restarting VSCode) to get the change to register? Or am I editing the wrong file?

    Coincidentally, I just today updated and just now came here to post that the file had again changed location to: .\resources\app\extensions\markdown-language-features\distserverWorkerMain.js

    However I didn't encounter the same trouble you are reporting. I was able to do a find and replace, finding the same string as previous:

    {return"#".repeat(e.level)+" "+e.text}
    

    and replacing it with:

    {return" ".repeat(e.level)+e.text}
    

    Saving and re-opening VSCode applied the fix for me as expected. However, I'm on Windows, maybe that makes a difference somehow?

    I'm quite befuddled as to why they have not fixed this obvious bug yet.

  19. AfroThundr3007730 commented on Nov 5, 2024

    @AfroThundr3007730

    For those who may be using a remote development extension, you can make the above edit using the below code (on the remote):

    shopt -s globstar
    # In an SSH remote
    sed -i 's/return"#".repeat(e.level)+" "+e.text/return e.text/g' \
        ~/.vscode-server/cli/servers/Stable-*/server/extensions/markdown-language-features/**/*.js
    # Or in a devcontainer
    sed -i 's/return"#".repeat(e.level)+" "+e.text/return e.text/g' \
        ~/.vscode-server/bin/*/extensions/markdown-language-features/**/*.js

    This will naturally need to be run again after an update.

  20. lxl80 commented on Apr 23, 2025

    @lxl80

    How come this problem has never been officially solved? How nice to give a configuration item, otherwise you have to change it manually every time you update the version.

  21. oeloo commented on Jun 18, 2025

    @oeloo

    I agree that the ## in the Outline View should not be visible in the VS Code Outline View.
    ## is a formatting marker for .md files for telling that this is a header, so it does not have its place when the header is represented as a header.

    Unfortunately, this issue has remained unresolved since 2018.
    Is there a VS Code extension extending the Outline View? The Outline view is a crucial Markdown feature that requires full attention.

  22. valkalon commented on Jul 30, 2025

    @valkalon

    if you could add the setting "Outline: Show markdown #" with a simple checkbox, that would be fantastic.

  23. Matsuyanagi commented on Mar 20, 2026

    @Matsuyanagi
  24. sck-jenzabar commented on May 27, 2026

    @sck-jenzabar

    I would also like to see the outline work when viewing the Markdown preview full screen. If this is also important to you, please consider upvoting this related issue: #316113

  25. nonplayer commented on Jun 18, 2026

    @nonplayer

    It's 2026, and this has been open now for eight years. In fact, in recent version 1.125.0 they even overhauled the entire serverWorkerMain.js file and changed the code... and still someone deliberately chose to keep this bug in place.

    The new snippet to search for is: return "#".repeat(entry.level) + " " + entry.text;

    Replace it with: return "".repeat(entry.level) + entry.text;

  26. valkalon commented on Jun 19, 2026

    @valkalon

    thanks N. Phillip Cole (@nonplayer) . Yes would be great to solve this finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestmarkdown-extunder-discussion

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions