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

False positive TOC detection #304

Closed
leesoh opened this issue Oct 17, 2018 · 10 comments
Closed

False positive TOC detection #304

leesoh opened this issue Oct 17, 2018 · 10 comments

Comments

@leesoh
Copy link

leesoh commented Oct 17, 2018

What is the problem?

When editing a page with a top-level title of #Foo, adding a link to a bulleted list later in the
document of Foo will cause that list to become a table of contents.

image

How can I disable this?

How can I reproduce it?

See above.

Is there any error message in the console?

No

yzhang-gh pushed a commit that referenced this issue Oct 17, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@yzhang-gh
Copy link
Owner

This should be robustly fixed with the dev build.

List not in the form of [...](#...) will never be recognized as TOC starting from this build.

@leesoh
Copy link
Author

leesoh commented Oct 17, 2018

Thank you very much!

@dialex
Copy link

dialex commented Oct 25, 2018

Is there a configuration to depth limit of TOC?
I don't mind the auto-update, as long as it stops at depth=3 (###).

@yzhang-gh
Copy link
Owner

You can control it with settings. (Workspace level is also supported)

@lastobelus
Copy link

lastobelus commented Jun 11, 2019

@yzhang-gh What if I need a list of internal links?

For example, I'm creating a document that has a section on goals, and a section on projects.

Each subsection in goals has a list of projects which relate to that goal. If I add more than three (four?) projects to the list it turns into a TOC. How can I prevent this? (I do want a TOC in the document, and have placed it at the beginning)

@yzhang-gh
Copy link
Owner

Can you provide a minimal example (code snippet)?

@DavidWells
Copy link

How do you turn this off? What is the setting name?

@yzhang-gh
Copy link
Owner

Please see here for more information about settings.

@yzhang-gh yzhang-gh changed the title Disable Auto-creation of TOC False positive TOC detection Aug 21, 2019
@damgot
Copy link

damgot commented Sep 25, 2019

Same problem here.
is it possible to have an option to just turn off TOC detection ?
I've my own extension to generate TOC (because I customize it a little).

@yzhang-gh
Copy link
Owner

Currently, we don't have such an option. I have opened a new issue for it.

If you have a little time and don't mind making a PR, here is the code pointer

export function activate(context: vscode.ExtensionContext) {

We have a similar option (as shown below), just copy it

export function activate(_: ExtensionContext) {
workspace.onDidChangeConfiguration(event => {
if (event.affectsConfiguration('markdown.extension.syntax.decorations')) {
window.showInformationMessage("Please reload VSCode to make setting `syntax.decorations` take effect.")
}
});
if (!workspace.getConfiguration('markdown.extension.syntax').get<boolean>('decorations')) return;

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

No branches or pull requests

6 participants