UNPKG

@wordpress/block-library

Version:
35 lines (32 loc) 965 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = save; var _blockEditor = require("@wordpress/block-editor"); var _utils = require("./utils"); var _jsxRuntime = require("react/jsx-runtime"); /** * WordPress dependencies */ /** * Internal dependencies */ function save({ attributes }) { return /*#__PURE__*/(0, _jsxRuntime.jsx)("pre", { ..._blockEditor.useBlockProps.save(), children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText.Content, { tagName: "code" // To do: `escape` encodes characters in shortcodes and URLs to // prevent embedding in PHP. Ideally checks for the code block, // or pre/code tags, should be made on the PHP side? , value: (0, _utils.escape)(typeof attributes.content === 'string' ? attributes.content : attributes.content.toHTMLString({ preserveWhiteSpace: true })) }) }); } //# sourceMappingURL=save.js.map