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

"Create Table of Contents" fails when the file contains tab #853

Closed
ParadoxGBB opened this issue Nov 25, 2020 · 7 comments · Fixed by #877
Closed

"Create Table of Contents" fails when the file contains tab #853

ParadoxGBB opened this issue Nov 25, 2020 · 7 comments · Fixed by #877
Assignees
Labels
Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). Issue: Bug Res: Fixed Fix is checked in, but it might be a few weeks until a release.
Milestone

Comments

@ParadoxGBB
Copy link

This seems related to previous bugs but was not able to isolate the problem. Installed the latest dev build and still reproduces.

Problem

I'm attempting to insert a ToC for the markdown here:

https://bitbucket.org/ParadoxGBB/cinadmin/src/master/README.md

The template of the format is provided by BitBucket.org.

This might be due to the commenting style I have for my code samples (# is a comment in PowerShell), however all of those examples are indented so should have been covered by other fixes.

How to reproduce

F1 + "Create Table of Contents"

Error message in the console

Command 'Markdown All in One: Create Table of Contents' resulted in an error (Cannot read property '1' of null)

@yzhang-gh

This comment has been minimized.

@yzhang-gh yzhang-gh added Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). Issue: Bug labels Nov 26, 2020
@Lemmingh

This comment has been minimized.

@yzhang-gh yzhang-gh added the Help wanted Looking for help. label Nov 26, 2020
@yzhang-gh

This comment has been minimized.

@ParadoxGBB
Copy link
Author

ParadoxGBB commented Dec 17, 2020

Thanks for the help with this. I tried removing that specific offending line (#CORE) and still got the same error. I scanned the code for another example of a comment within a block and didn't find any --- so I suspect there might be another issue lurking in there somewhere.

EDIT: I also tried removing the comment here, still doesn't work:

$ACQUISITION_DOWNLOAD_SUBTITLES = $false #Only supports TTML

@Lemmingh
Copy link
Collaborator

Lemmingh commented Dec 18, 2020

There are ~40 occurrences of \t# in your file.


Not sure what I did in this WIP branch (dev/fix/heading-recognition):
https://github.com/yzhang-gh/vscode-markdown/tree/a848db4c32ca00c91a2cf2b426da414ece4d9991

but the problem is accidentally solved there. 😂

WARNING: Do not use that branch in production. It is still partial work, and does not pass all tests.

@Lemmingh Lemmingh self-assigned this Dec 18, 2020
@Lemmingh Lemmingh changed the title Error adding ToC: Cannot read property '1' of null "Create Table of Contents" fails when the file contains tab Dec 18, 2020
@ParadoxGBB
Copy link
Author

My mistake, I thought the scope of the problem was a hash comment within an indented codeblock ({...}). Thanks for the clarification.

@Lemmingh Lemmingh removed the Help wanted Looking for help. label Dec 22, 2020
@Lemmingh Lemmingh added this to the Next milestone Jan 17, 2021
@Lemmingh Lemmingh added the Res: Fixed Fix is checked in, but it might be a few weeks until a release. label Jan 17, 2021
@ParadoxGBB
Copy link
Author

Installed this build and works great! Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). Issue: Bug Res: Fixed Fix is checked in, but it might be a few weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants