2022-01-29 21:31:48 +01:00
|
|
|
class InlineCode extends HTMLElement {
|
|
|
|
constructor() {
|
|
|
|
super();
|
2022-03-25 10:18:57 +01:00
|
|
|
const codeElement = document.createElement("code");
|
|
|
|
if (this.hasAttribute("language")) {
|
|
|
|
codeElement.classList.add(this.getAttribute("language"));
|
|
|
|
} else {
|
|
|
|
codeElement.classList.add("language-text");
|
|
|
|
}
|
|
|
|
codeElement.innerHTML = this.innerHTML;
|
|
|
|
this.appendChild(codeElement);
|
2022-01-29 21:31:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
customElements.define("jl-code", InlineCode);
|