fix(site): non-unique IDs in code-block
This commit is contained in:
parent
f4e74474c8
commit
82c11ea1d5
2 changed files with 2 additions and 3 deletions
|
@ -5,13 +5,13 @@ class CodeBlockComponent extends HTMLElement {
|
||||||
const inline = this.getAttribute("inline") !== null;
|
const inline = this.getAttribute("inline") !== null;
|
||||||
|
|
||||||
this.innerHTML = `
|
this.innerHTML = `
|
||||||
<pre id="pre"><code id="code">${trimmed}</code></pre>
|
<pre><code id="code">${trimmed}</code></pre>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {HTMLPreElement}
|
* @type {HTMLPreElement}
|
||||||
*/
|
*/
|
||||||
const pre = this.querySelector("#pre");
|
const pre = this.querySelector("pre");
|
||||||
|
|
||||||
if (lang) {
|
if (lang) {
|
||||||
pre.className = `language-${lang}`;
|
pre.className = `language-${lang}`;
|
||||||
|
|
|
@ -64,7 +64,6 @@ customElements.define("my-counter", Counter);
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<my-footer>
|
<my-footer>
|
||||||
<!-- <p>View page <a href="https://github.com/ayoayco/web-component-base/blob/main/site/src/pages/index.html">source code</a></p> -->
|
|
||||||
<span>This site is built with
|
<span>This site is built with
|
||||||
<a href="https://github.com/ayoayco/McFly">McFly</a>, the no-framework framework;
|
<a href="https://github.com/ayoayco/McFly">McFly</a>, the no-framework framework;
|
||||||
</span><br />
|
</span><br />
|
||||||
|
|
Loading…
Reference in a new issue