naokazuterada / MarkdownTOC

SublimeText3 plugin which generate a table of contents (TOC) in a markdown document.
https://packagecontrol.io/packages/MarkdownTOC
MIT License
301 stars 48 forks source link

[Feature request] Replace name attribute #115

Closed Kristinita closed 6 years ago

Kristinita commented 6 years ago

1. Summary

See any page from my site in Validator.nu. I get many warnings:

Warning: The name attribute is obsolete. Consider putting an id attribute on the nearest container instead.

It would be nice, if in MarkdownTOC name attribute will replace to non-obsolete.

See example solution.

2. Environment

Example MarkdownTOC.sublime-settings file:

{
    "default_autoanchor": true,
    "default_autolink": true,
    "default_bracket": "round",
    "default_style": "ordered",
}

Example SashaTOC.md file:

# Sasha header

---

## Sasha subheader

3. Steps to reproduce

I reproduce the problem in a version of Sublime Text without plugins and user settings.

I place carriage in beginning of SashaTOC.md file → Ctrl+Shift+P (⌘⇧p for Mac) → MarkdownTOC: Insert TOC.

4. Actual behavior

<!-- MarkdownTOC -->

1. [**Sasha header**](#sasha-header)
    1. [**Sasha subheader**](#sasha-subheader)

<!-- /MarkdownTOC -->

<a name="sasha-header"></a>
# Sasha header

<a name="sasha-subheader"></a>
---

## Sasha subheader

5. Expected behavior

See example.

Thanks.