@wordpress/block-library
Version:
Block library for the WordPress editor.
50 lines (49 loc) • 1.17 kB
JavaScript
import { useBlockProps } from "@wordpress/block-editor";
import { jsx } from "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__ */ jsx("div", {
...useBlockProps.save(),
children: /* @__PURE__ */ jsx("math", {
display: "block",
dangerouslySetInnerHTML: { __html: mathML }
})
});
}
}, {
attributes: legacyAttributes,
save({ attributes }) {
const { latex, mathML } = attributes;
if (!latex) return null;
return /* @__PURE__ */ jsx("math", {
...useBlockProps.save(),
display: "block",
dangerouslySetInnerHTML: { __html: mathML }
});
}
}];
export { deprecated_default as default };
//# sourceMappingURL=deprecated.mjs.map