UNPKG

@nuxtjs/mdc

Version:
15 lines (14 loc) 487 B
import { kebabCase } from "scule"; import { getTagName } from "./utils.js"; export default function html(state, node) { const tagName = getTagName(node.value); if (tagName && /[A-Z]/.test(tagName)) { node.value = node.value.replace(tagName, kebabCase(tagName)); } if (state.dangerous || state.options?.allowDangerousHtml) { const result = { type: "raw", value: node.value }; state.patch(node, result); return state.applyData(node, result); } return void 0; }