Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Unable to create "spacers" in TOC with blank h1s like with Slate #66

Closed
dustinloflandsmith opened this issue Jun 13, 2019 · 5 comments
Closed
Assignees

Comments

@dustinloflandsmith
Copy link

Hi @MikeRalphson, could use your help on a nitpicky little issue I'm having.

Using lord/slate, I can include a _blank.md file containing only the code

<h1 id="_"><br> </h1>

wherever I need to create a gap between items in the TOC.

Slate renders this as

<a href="#_" class="toc-h1 toc-link" data-title=" "><br> </a>

in the resulting index.html file.

Using the exact same source files in shins doesn't display the same behavior, it renders as

<a href="#_" class="toc-h1 toc-link" data-title=" "> </a>

without the <br> and I can't figure out how to get shins to keep it!

@MikeRalphson
Copy link
Contributor

From a quick look it shouldn't affect things, but could you check if using the --unsafe option to disable html sanitisation helps at all?

@dustinloflandsmith
Copy link
Author

Just gave it a try and the behavior persists while using --unsafe.

@MikeRalphson
Copy link
Contributor

Are you able to test latest master from github? If not, don't worry and I'll cut a new release.

@dustinloflandsmith
Copy link
Author

Just tested on the latest master, with and without --unsafe --> the ToC includes the headers now but the <br> is included as text.
Also tested with:

  • <h1 id="_">&nbsp</h1> ---> everything inside <h1> tags appears in ToC as text
  • <h1 id="_"><&nbsp></h1> ^ (same as above)
  • <h1 id="_"><pre></pre></h1> ^ (same as above)
  • <h1 id="_"><pre> </pre></h1> ^ (same as above)
  • just a plain space (i.e. <h1 id="_"> </h1>)--> nothing appears in the ToC.

@MikeRalphson
Copy link
Contributor

Please continue the discussion over on slant if still an issue.

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

No branches or pull requests

2 participants