Skip to content

The open alternative to Salesforce, designed for AI.

295 B
Raw Blame
import { getBlockStyle } from '@/advanced-text-editor/utils/getBlockStyle';

export const readBlockStyleAttribute = (
  element: HTMLElement,
): Record<string, string> => {
  try {
    return getBlockStyle(JSON.parse(element.getAttribute('data-style') ?? ''));
  } catch {
    return {};
  }
};