UNPKG

@curvenote/schema

Version:

Schema and markdown parser for @curvenote/editor

43 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toTex = exports.toMarkdown = void 0; const utils_1 = require("../serialize/tex/utils"); const types_1 = require("./types"); const aside = { attrs: {}, group: types_1.NodeGroups.top, content: types_1.NodeGroups.blockOrHeading, toDOM() { return ['aside', { class: 'margin' }, 0]; }, parseDOM: [ { tag: 'aside' }, { tag: 'aside.margin' }, ], attrsFromMyst() { return {}; }, toMyst(props) { return { type: 'margin', children: (props.children || []), }; }, }; const toMarkdown = (state, node) => { state.ensureNewLine(); // This is a bit of a hack, callouts often have other directives state.write('````{margin}'); state.ensureNewLine(); state.renderContent(node); state.write('````'); state.closeBlock(node); }; exports.toMarkdown = toMarkdown; exports.toTex = (0, utils_1.createLatexStatement)(() => ({ command: 'aside', }), (state, node) => { state.renderContent(node); }); exports.default = aside; //# sourceMappingURL=aside.js.map