secst
Version:
SECST is a semantic, extensible, computational, styleable tagged markup language. You can use it to joyfully create compelling, interactive documents backed by HTML.
27 lines (24 loc) • 579 B
JavaScript
import textContent from "./text-content.js";
const headings = {
h: {
contentAllowed: {
...textContent
},
transform(node,{level}) {
if(node.attributes.level) {
level = node.attributes.level;
}
node.tag = "h" + level;
delete node.attributes.level;
return node;
}
}
};
for(let i=1;i<=8;i++) {
headings["h"+i] = {
contentAllowed: {
...textContent
}
}
}
export {headings,headings as default}