Skip to content
Snippets Groups Projects
Verified Commit 04e198c6 authored by Jonas Leder's avatar Jonas Leder
Browse files

add option to set language with attribute

parent 031cccb4
Branches
No related tags found
No related merge requests found
class InlineCode extends HTMLElement {
constructor() {
super();
this.innerHTML = "<code class=\"language-text\">" + this.innerHTML + "</code>";
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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment