Forced Layout
Features
- Automatically ensures the use of specified elements as required to maintain document structure (e.g., first block should be an H1 element).
- To force a trailing block of a specific type, see Trailing Block.
Usage
import { NormalizeTypesPlugin } from 'platejs';
const plugins = [
// ...otherPlugins
NormalizeTypesPlugin.configure({
options: {
rules: [{ path: [0], strictType: 'h1' }],
},
}),
];