-
Notifications
You must be signed in to change notification settings - Fork 5
Description
The plugin currently generates an html code where the title of the special notes/admonitions are given an html heading h5.
remarkable-admonitions/src/renderer.ts
Lines 19 to 25 in 042d6e1
| return ` | |
| <div class="admonition admonition-${token.admonition}"> | |
| <div class="admonition-heading"> | |
| <h5>${iconTemplate} ${token.title || token.admonition}</h5> | |
| </div> | |
| <div class="admonition-content"> | |
| `; |
This is an issue from both semantics and accessibility aspect. If I have the following structure in my markdown:
# My page/document title
## Section heading
Some introduction about this heading and here's a special note:
:::caution Something to keep in mind
some text here
:::
...The above will produce the following hierarchy when the html page is generated:
h1 My page/document title
h2 Section heading
Some introduction about this heading and here's a special note:
h5 Something to keep in mind
some text here
...
Semantically that's inaccurate because after h2, the next sub-heading should be h3. For the same reason, it also fails the accessibility tests in Google's Lighthouse audit.
I think this plugin should not use h5 as the title of the notes. It can probably use a span (or something more appropriate) with a classname and then adjust the font size accordingly.