API / @aionbuilders/nabu/extend

HtmlRule

Type Stability: stable

selector is a CSS selector tested with el.matches(). priority: higher is tried first (a specific block beats a generic fallback). filter: an extra test once the selector matches. embed: the element may sit inside the inline content of another block and is then lifted out as a block of its own. props: props the rule asks fromHTML to set.

Definition

TypeScript
import type { HtmlRule } from '@aionbuilders/nabu/extend';
TypeScript
type HtmlRule = {
  embed?: boolean;
  filter?: (el: Element) => boolean;
  priority?: number;
  props?: Record<string, any>;
  selector: string;
  [field: string]: any;
}

Properties

Properties of HtmlRule
PropertyTypeDescription
embedoptionalbooleann/a
filteroptional(el: Element) => booleann/a
priorityoptionalnumbern/a
propsoptionalRecord<string, any>n/a
selectorstringn/a

Source: src/lib/utils/extensions.js:57