• Rose

    (@thorned-rose)


    Works straight out of the box and does exactly what it says. All I wanted was a nice simple ToC without unneccesary bloat and this does just that.

    One thing I would have liked to have seen is that the jump links created were the text of the headers and not just “heading-1”, “heading-2″, etc. e.g. – My first h1 title – should be <h1 id=”my-first-h1-title”>My first h1 title</h1>. Better for SEO and better for screen readers. This is the only reason I didn’t give 5/5.

    Otherwise stellar plugin!

Viewing 1 replies (of 1 total)
  • Plugin Author dashaluna

    (@dashaluna)

    Thank you for the feedback @thorned-rose

    The reason I went for the current solution is that there is no guarantee that in content there won’t be multiple headers with exactly the same text. I know this is unlikely, but might happen.

    In this case, we will have an invalid HTML, because there will be multiple tags with the same id.

    For example:

    Some text...
    <h1>Some Title</h1>
    Some text...
    <h1>Some Title</h1>
    Some text...

    Will result in:

    <h1 id="some-title">Some Title</h1>
    <h1 id="some-title">Some Title</h1>

    And before the actual headings the anchors are inserted with the same id, so both link will just for the first occurrence only. I hope that makes sense.

    I’m open to suggestions to improve this, bearing in mind that header text might not be unique.

Viewing 1 replies (of 1 total)
  • The topic ‘Simple and works’ is closed to new replies.