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 26 27 | 1x 85x 85x 85x 2x 85x 2x 105x 2x 105x 2x | import type { AriaFormat } from 'roosterjs-content-model-types';
import type { FormatHandler } from '../FormatHandler';
/**
* @internal
*/
export const ariaFormatHandler: FormatHandler<AriaFormat> = {
parse: (format, element) => {
const ariaDescribedBy = element.getAttribute('aria-describedby');
const title = element.getAttribute('title');
if (ariaDescribedBy) {
format.ariaDescribedBy = ariaDescribedBy;
}
if (title) {
format.title = title;
}
},
apply: (format, element) => {
if (format.ariaDescribedBy) {
element.setAttribute('aria-describedby', format.ariaDescribedBy);
}
if (format.title) {
element.setAttribute('title', format.title);
}
},
};
|