UNPKG

pimd

Version:

Processing instructions for Markdown

23 lines (19 loc) 510 B
const Fragment = require("../fragment") module.exports = class ProcessingInstruction extends Fragment { static get template() { return "" } static get fragmentType() { return "pi" } constructor(renderer, options, name, content) { super(...arguments) this.name = name this.content = content this.element = this.parentNode if (renderer.config.commands[name]) { const html = renderer.config.commands[name](this) if (html) this.dom.innerHTML = html } } }