@wordpress/blocks
Version:
Block API for WordPress.
24 lines • 1.05 kB
TypeScript
import type { BlockType } from '../../types';
/**
* Given an HTML string, returns an array of class names assigned to the root
* element in the markup.
*
* @param innerHTML Markup string from which to extract classes.
*
* @return Array of class names assigned to the root element.
*/
export declare function getHTMLRootElementClasses(innerHTML: string): string[];
/**
* Given a parsed set of block attributes, if the block supports custom class
* names and an unknown class (per the block's serialization behavior) is
* found, the unknown classes are treated as custom classes. This prevents the
* block from being considered as invalid.
*
* @param blockAttributes Original block attributes.
* @param blockType Block type settings.
* @param innerHTML Original block markup.
*
* @return Filtered block attributes.
*/
export declare function fixCustomClassname(blockAttributes: Record<string, unknown>, blockType: BlockType, innerHTML: string): Record<string, unknown>;
//# sourceMappingURL=fix-custom-classname.d.ts.map