parse-blocks-helpers.ts

src/utils/parse-blocks-helpers.ts
import { 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 false
return 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

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC