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

Ignore headers in code block #40

Closed
wants to merge 1 commit into from
Closed

Conversation

syohex
Copy link
Collaborator

@syohex syohex commented Dec 3, 2015

This is related to #27 , ardumont/markdown-toc#13
CC: @Wilfred, @ardumont

In original code, statements which looks like markdown header such as shebang in code block are handled as markdown header. For example, markdown-toc generates table of contents form markdown headers which is retrieved by markdown-imenu-create-index.

 # Heading

 ## subheading

 ```
 foo
 # bar
 baz
 ```

 ## another subheading

markdown-toc generates following table of contents with original code. #bar in code block is handled as markdown header.

<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
**Table of Contents**

- [Heading](#heading)
    - [subheading](#subheading)
- [bar](#bar)
    - [another subheading](#another-subheading)

<!-- markdown-toc end -->

markdown-toc generates following table of contenst with this change.

<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
**Table of Contents**   
- [Heading](#heading)
    - [subheading](#subheading)
    - [another subheading](#another-subheading)
<!-- markdown-toc end -->

@jrblevin
Copy link
Owner

jrblevin commented Dec 6, 2015

Thanks for this patch! Perhaps your new markdown-collect-fm-code-blocks function could be used for font locking to also fix #33?

@syohex
Copy link
Collaborator Author

syohex commented Dec 6, 2015

Perhaps your new markdown-collect-fm-code-blocks function could be used for font locking to also fix #33?

I'll check.

@syohex syohex deleted the better-imenu branch December 7, 2015 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants