rhino-editor
Version:
A custom element wrapped rich text editor
14 lines (12 loc) • 434 B
JavaScript
// src/exports/extensions/find-attribute.ts
function findAttribute(element, attribute) {
const attr = element.closest("action-text-attachment")?.getAttribute(attribute);
if (attr) return attr;
const attrs = element.closest("[data-trix-attachment]")?.getAttribute("data-trix-attachment");
if (!attrs) return null;
return JSON.parse(attrs)[attribute];
}
export {
findAttribute
};
//# sourceMappingURL=chunk-4PTK2Z3Z.js.map