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

list formatting in template has wrong semantics #17

Open
lid3rs opened this issue Jul 13, 2017 · 6 comments
Open

list formatting in template has wrong semantics #17

lid3rs opened this issue Jul 13, 2017 · 6 comments

Comments

@lid3rs
Copy link

lid3rs commented Jul 13, 2017

While the TOC list generated in html, it has wrong nesting:

Template: toc.html.twig

Wrong:

<li>
  h1
</li>
<ul>
  <li>h2</li>
</ul>

Should be:

<li>
  h1
  <ul>
    <li>h2</li>
  </ul>
</li>
@Sommerregen
Copy link
Owner

Hi @lid3rs ,

sorry I can't reproduce even when looking at the code toc.html.twig. There is no place that has your structure, i.e., </li><ul>. I think it is on your end, maybe a plugin interfering with the output or some truncation?

@lid3rs
Copy link
Author

lid3rs commented Jul 14, 2017

My mistake, sorry. But if we are already here, is it possible somehow to create an object like:

h1
  h2
    h3
  h2
etc.

because now it is:

h1
h2
h3
h2
etc.

And in this view it's hard to format it correctly with the list.

@Sommerregen
Copy link
Owner

Hi @lid3rs ,

Sorry I still don't understand your point. The plugin already emits a list hierarchy with links,e.g.,

<ul>
  <li><a>My heading</a></li>
  <li><ul>
    <li><a>My Sub-heading 1</a></li>
    <li><a>My Sub-heading 2</a></li>
  </ul></li>
  ...
</ul>

You can adjust the template to use other semantics. I still think either your theme or a plugin mingles something up. See my screenshot:

toc

@lid3rs
Copy link
Author

lid3rs commented Aug 7, 2017

Hi @Sommerregen
This is interesting, i'll try to revert the TOC template. My semantics was different.

@lid3rs
Copy link
Author

lid3rs commented Aug 10, 2017

@Sommerregen

Ok, got you code working, and it works semantically incorrect. I could not manage it by myself, but the result:

Your's is:

 <li>item</li>
 <li>
  <ul>
    <li>subitem</li>
  </ul>
 </li>

Should be:

 <li>item
  <ul>
   <li>subitem</li>
  </ul>
 </li>

This results in some problems with css:

content: counters(section, ".") " ";

@Sommerregen
Copy link
Owner

@lid3rs You still have the wrong code. I tested with Toc v1.4.1 + Antimatter, standard settings and I really can't reproduce your issue. You still have either a problem in your template or there is a indeed a bug. However I can't test it without any real example. What did you do? How is your markdown page formatted? Please include a working example or send me your user folder, i.e., via slack.

Thanks in advance.

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

No branches or pull requests

2 participants