@wordpress/block-library
Version:
Block library for the WordPress editor.
40 lines (37 loc) • 1.03 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _autop = require("@wordpress/autop");
/**
* WordPress dependencies
*/
const transforms = {
from: [{
type: 'shortcode',
// Per "Shortcode names should be all lowercase and use all
// letters, but numbers and underscores should work fine too.
// Be wary of using hyphens (dashes), you'll be better off not
// using them." in https://codex.wordpress.org/Shortcode_API
// Require that the first character be a letter. This notably
// prevents footnote markings ([1]) from being caught as
// shortcodes.
tag: '[a-z][a-z0-9_-]*',
attributes: {
text: {
type: 'string',
shortcode: (attrs, _ref) => {
let {
content
} = _ref;
return (0, _autop.removep)((0, _autop.autop)(content));
}
}
},
priority: 20
}]
};
var _default = transforms;
exports.default = _default;
//# sourceMappingURL=transforms.js.map
;