src/utils/parse-blocks-helpers.tsimport { type DOMNode, Element } from 'html-react-parser'export function isTag(node: any): node is Element {return node.type === 'tag'}export function hasExactClass(className: string | undefined,target: string): boolean {if (!className) return falsereturn new RegExp(`(^|\\s)${target}(\\s|$)`).test(className)}export function getAttrib(node: Element, name: string): string {return node.attribs?.[name] || ''}export function getClassName(node: Element): string {return getAttrib(node, 'class')
Showing the first 20 lines.
Get full code