MCPcopy Create free account
hub / github.com/Effect-TS/effect / cdata

Method cdata

packages/effect/src/encoding/Xml.ts:2098–2105  ·  view source on GitHub ↗
(s: string, i: number)

Source from the content-addressed store, hash-verified

2096 }
2097
2098 private cdata(s: string, i: number): number {
2099 const end = s.indexOf("]]>", i + 9)
2100 if (end === -1) return -1
2101 if (this.state !== CONTENT) throw this.syntax("CDATA sections are only allowed inside the root element", i)
2102 this.addText(i, end + 3 - i)
2103 this.text += normalizeLines(s.slice(i + 9, end))
2104 return end + 3
2105 }
2106
2107 private doctypeDeclaration(s: string, i: number): number {
2108 if (this.state !== PROLOG || this.doctype) {

Callers 1

markupMethod · 0.95

Calls 4

syntaxMethod · 0.95
addTextMethod · 0.95
normalizeLinesFunction · 0.85
sliceMethod · 0.80

Tested by

no test coverage detected