Skip to content

Commit

Permalink
fix(docs): remove headings' ids to prevent duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed Mar 3, 2022
1 parent ee4e117 commit c32b5ab
Show file tree
Hide file tree
Showing 7 changed files with 460 additions and 457 deletions.
3 changes: 3 additions & 0 deletions a11y.css.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ const parseSassComment = comment => {
ghCompatibleHeaderId: true
}).makeHtml(content.body)

const headingsRegex = /(<h([2-5]).*>(.*)<\/h[2-5]>)/gim
processedContent = processedContent.replace(headingsRegex, `<h$2>$3</h$2>`)

// HTML code blocks
const markupRegex = /((<pre><code class="html language-html">)(.[\s\S]+?)(\/code><\/pre>))/gm
const htmlRegex = /((?<=<code class="html language-html">)(.[\s\S]+?)(?=<\/code>))/gm
Expand Down
172 changes: 86 additions & 86 deletions docs/advices/index.html

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions docs/api/index.html

Large diffs are not rendered by default.

304 changes: 152 additions & 152 deletions docs/errors/index.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/obsoletes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ <h1>Obsoletes</h1>

<article>
<h2 id="tags">Old school tags</h2>
<h3 id="description">Description</h3>
<h3>Description</h3>
<p>Many, many tags are obsolete in HTML5. You should care!</p>
<h3 id="references">References</h3>
<h3>References</h3>
<ul>
<li><a href="https://www.w3.org/TR/html5/obsolete.html#obsolete">https://www.w3.org/TR/html5/obsolete.html#obsolete</a></li>
<li><a href="https://www.w3.org/TR/html52/changes.html#features-removed">https://www.w3.org/TR/html52/changes.html#features-removed</a></li>
<li><a href="https://references.modernisation.gouv.fr/rgaa/criteres.html#crit-8-2">https://references.modernisation.gouv.fr/rgaa/criteres.html#crit-8-2</a></li>
</ul>
<h3 id="selector">Selector</h3>
<h3>Selector</h3>
<div class="pre"><pre><code class="css language-css">applet<span class="token punctuation">,</span>
acronym<span class="token punctuation">,</span>
bgsound<span class="token punctuation">,</span>
Expand Down Expand Up @@ -189,25 +189,25 @@ <h3 id="selector">Selector</h3>
menu<span class="token punctuation">,</span>
menuitem
</code></pre></div>
<h3 id="test">Test</h3>
<h3>Test</h3>
<div class="pre"><div><acronym title="World Wide Web Consortium">W3C</acronym>
</div><pre><code class="html language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>acronym</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>World Wide Web Consortium<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>W3C<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>acronym</span><span class="token punctuation">></span></span>
</code></pre></div>
</article>

<article>
<h2 id="attributes">Old school attributes</h2>
<h3 id="description">Description</h3>
<h3>Description</h3>
<p>Many, many attributes are obsolete in HTML5. You should care!</p>
<h3 id="references">References</h3>
<h3>References</h3>
<ul>
<li><a href="https://www.w3.org/TR/html5/obsolete.html#obsolete">https://www.w3.org/TR/html5/obsolete.html#obsolete</a></li>
<li><a href="https://w3c.github.io/html/obsolete.html#non-conforming-features">https://w3c.github.io/html/obsolete.html#non-conforming-features</a></li>
<li><a href="https://www.w3.org/TR/html52/changes.html#features-removed">https://www.w3.org/TR/html52/changes.html#features-removed</a></li>
<li><a href="https://references.modernisation.gouv.fr/rgaa/criteres.html#crit-8-2">https://references.modernisation.gouv.fr/rgaa/criteres.html#crit-8-2</a></li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta</a></li>
</ul>
<h3 id="selector">Selector</h3>
<h3>Selector</h3>
<div class="pre"><pre><code class="css language-css">[dropzone]<span class="token punctuation">,</span>
a[charset]<span class="token punctuation">,</span> link[charset]<span class="token punctuation">,</span>
a[coords]<span class="token punctuation">,</span>
Expand Down Expand Up @@ -289,7 +289,7 @@ <h3 id="selector">Selector</h3>
td[nowrap]<span class="token punctuation">,</span> th[nowrap]<span class="token punctuation">,</span>
body[background]<span class="token punctuation">,</span> table[background]<span class="token punctuation">,</span> thead[background]<span class="token punctuation">,</span> tbody[background]<span class="token punctuation">,</span> tfoot[background]<span class="token punctuation">,</span> tr[background]<span class="token punctuation">,</span> td[background]<span class="token punctuation">,</span> th[background]
</code></pre></div>
<h3 id="test">Test</h3>
<h3>Test</h3>
<div class="pre"><div><h3 align="right">I'm using [align]!</h3>
</div><pre><code class="html language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h3</span> <span class="token attr-name">align</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>right<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>I'm using [align]!<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h3</span><span class="token punctuation">></span></span>
</code></pre></div>
Expand Down
Loading

0 comments on commit c32b5ab

Please sign in to comment.