badboy / mdbook-toc

A preprocessor for mdbook to add inline Table of Contents support.
Mozilla Public License 2.0
163 stars 20 forks source link

Enhancement: Ignore white spaces inside "<!-- toc -->" marker #14

Closed apatniv closed 3 years ago

apatniv commented 3 years ago

Thank you creating a very useful crate for generating toc.

The code expects that user type in exactly <!-- toc --> verbatim and if there any spaces after/before toc, it is not recognized as marker.

For example, this is not recognized as marker

<!--   toc -->

I am more than happy to do the changes if you feel if this improves the user experience.

badboy commented 3 years ago

I don't think it's worth it. If you specify a marker then that's the marker verbatim. Whitespace inside it is significant and should not be stripped, if anything to reduce complexity of the implementation.

apatniv commented 3 years ago

@badboy No problems. Thanks you for the feedback.