MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / rawTextElementEndOffset

Function rawTextElementEndOffset

src/cm/modes/astro/parser/tokens.ts:174–191  ·  view source on GitHub ↗
(
	input: Input,
	offset: number,
)

Source from the content-addressed store, hash-verified

172}
173
174function rawTextElementEndOffset(
175 input: Input,
176 offset: number,
177): number | null {
178 if (startsWithTagName(input, offset, "script")) {
179 const openTag = tagEnd(input, offset);
180 if (openTag.selfClosing) return openTag.end;
181 return closeTagEndOffset(input, openTag.end, "script");
182 }
183
184 if (startsWithTagName(input, offset, "style")) {
185 const openTag = tagEnd(input, offset);
186 if (openTag.selfClosing) return openTag.end;
187 return closeTagEndOffset(input, openTag.end, "style");
188 }
189
190 return null;
191}
192
193function htmlCommentEndOffset(input: Input, offset: number): number | null {
194 if (

Callers 1

htmlContentEndOffsetFunction · 0.85

Calls 3

startsWithTagNameFunction · 0.85
tagEndFunction · 0.85
closeTagEndOffsetFunction · 0.85

Tested by

no test coverage detected