UNPKG

@wordpress/block-library

Version:
55 lines (54 loc) • 1.43 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); let _wordpress_block_editor = require("@wordpress/block-editor"); let react_jsx_runtime = require("react/jsx-runtime"); // packages/block-library/src/math/deprecated.jsx const legacyAttributes = { latex: { type: "string", role: "content" }, mathML: { type: "string", source: "html", selector: "math" } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ var deprecated_default = [{ attributes: legacyAttributes, save({ attributes }) { const { latex, mathML } = attributes; if (!latex) return null; return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ..._wordpress_block_editor.useBlockProps.save(), children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("math", { display: "block", dangerouslySetInnerHTML: { __html: mathML } }) }); } }, { attributes: legacyAttributes, save({ attributes }) { const { latex, mathML } = attributes; if (!latex) return null; return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("math", { ..._wordpress_block_editor.useBlockProps.save(), display: "block", dangerouslySetInnerHTML: { __html: mathML } }); } }]; exports.default = deprecated_default; //# sourceMappingURL=deprecated.cjs.map