markdown-menu icon indicating copy to clipboard operation
markdown-menu copied to clipboard

Odd behavior when there are gaps between header levels

Open willpiers opened this issue 10 years ago • 1 comments

you can see an example here https://github.com/RallySoftware/burro/blob/master/UE_SHELL.md

Basically if the structure of the markdown file uses an h6 as a child of an h2 there will be extra padding generated by the padding-left that github applies to uls. I wonder if your extension could be smart enough to not add extra uls

willpiers avatar Apr 07 '15 20:04 willpiers

Yeah, I think we can handle that. Right now the logic is simple to handle hierarchy.

What would you expect if you have, say, an h3 elsewhere? Perhaps also a child of the h2, after the h6 children:

  • h1
    • h2
      • h6
      • h3

I guess we can collapse level 6 to level 4 to maintain that distinction.

What if we have:

  • h1
    • h2
      • h6
    • h2
      • h3

... we'd probably only want to collapse levels missing from the full tree, and squash the h6 to what would be an h4.

A generic algorithm that handles unexpected hierarchies should be possible. I'll try this after I get some more browsers supported. :smile:

willklein avatar Apr 07 '15 20:04 willklein