"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializerTokens = void 0;
const nodes_1 = require("../../../../utils/nodes.js");
const placeholder_1 = require("../../../../utils/placeholder.js");
const const_1 = require("./const.js");
exports.serializerTokens = {
    [const_1.NoteNode.Note]: (state, node) => {
        state.renderContent(node);
        state.write('{% endnote %}');
        state.closeBlock(node);
    },
    [const_1.NoteNode.NoteTitle]: (state, node, parent) => {
        state.write(`{% note ${parent.attrs[const_1.NoteAttrs.Type]} `);
        if (node.nodeSize > 2) {
            state.write('"');
            state.renderInline(node);
            state.write('"');
        }
        else {
            const placeholder = (0, placeholder_1.getPlaceholderContent)(node);
            if (placeholder)
                state.write(`"${placeholder}"`);
        }
        state.write(' %}\n');
        state.write('\n');
        state.closeBlock();
    },
    [const_1.NoteNode.NoteContent]: (state, node) => {
        if (!(0, nodes_1.isNodeEmpty)(node))
            state.renderInline(node);
        else
            state.write((0, placeholder_1.getPlaceholderContent)(node) + '\n\n');
    },
};
//# sourceMappingURL=serializer.js.map
