MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / replaceTagAtMatch

Function replaceTagAtMatch

packages/studio/src/utils/sourcePatcher.ts:234–236  ·  view source on GitHub ↗
(html: string, match: TagMatch, newTag: string)

Source from the content-addressed store, hash-verified

232}
233
234function replaceTagAtMatch(html: string, match: TagMatch, newTag: string): string {
235 return `${html.slice(0, match.start)}${newTag}${html.slice(match.end)}`;
236}
237
238function execDataAttrPattern(html: string, attr: string, value: string): TagMatch | null {
239 const pattern = new RegExp(`(<[^>]*\\b${attr}=(["'])${escapeRegex(value)}\\2[^>]*)>`, "i");

Callers 3

patchInlineStyleByTargetFunction · 0.85
patchAttributeByTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected