'use strict'; const core = require('@milkdown/core'); const themeNord = require('@milkdown/theme-nord'); const presetGfm = require('@milkdown/preset-gfm'); const pluginEmoji = require('@milkdown/plugin-emoji'); const pluginIndent = require('@milkdown/plugin-indent'); const pluginMath = require('@milkdown/plugin-math'); const pluginSlash = require('@milkdown/plugin-slash'); const pluginTooltip = require('@milkdown/plugin-tooltip'); const pluginUpload = require('@milkdown/plugin-upload'); const pluginMenu = require('@milkdown/plugin-menu'); const pluginHistory = require('@milkdown/plugin-history'); const pluginClipboard = require('@milkdown/plugin-clipboard'); const pluginPrism = require('@milkdown/plugin-prism'); const plugins = [ themeNord.nord, presetGfm.gfm, pluginEmoji.emoji, pluginIndent.indent, pluginMath.math, pluginSlash.slash, pluginTooltip.tooltip, pluginUpload.upload, pluginMenu.menu, pluginHistory.history, pluginClipboard.clipboard, pluginPrism.prism ].flat(); function createMilkdownCore(root) { return core.Editor.make().config((ctx) => { ctx.set(core.rootCtx, root); }).use(plugins); } exports.createMilkdownCore = createMilkdownCore;