Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1x 8435x 45973x | import type {
ContentModelFormatBase,
FormatApplier,
ModelToDomContext,
} from 'roosterjs-content-model-types';
/**
* @internal
* Apply formats to the given HTML element using specified appliers
* @param element The element to apply formats to
* @param appliers The appliers we are using to apply formats
* @param format The format object we get format info from
* @param context Content Model to DOM context
*/
export function applyFormat<T extends ContentModelFormatBase>(
element: HTMLElement,
appliers: (FormatApplier<T> | null)[],
format: T,
context: ModelToDomContext
) {
appliers.forEach(applier => {
applier?.(format, element, context);
});
}
|