MCPcopy Create free account
hub / github.com/denoland/std / #readDoctypeQuotedString

Method #readDoctypeQuotedString

xml/_tokenizer.ts:716–732  ·  view source on GitHub ↗

Read a quoted string in DOCTYPE. Does not handle cross-chunk boundaries.

()

Source from the content-addressed store, hash-verified

714
715 /** Read a quoted string in DOCTYPE. Does not handle cross-chunk boundaries. */
716 #readDoctypeQuotedString(): string {
717 const quote = this.#doctypeQuoteChar;
718 const buffer = this.#buffer;
719 const bufferLen = buffer.length;
720 let value = "";
721 while (
722 this.#bufferIndex < bufferLen && buffer[this.#bufferIndex] !== quote
723 ) {
724 value += buffer[this.#bufferIndex];
725 this.#advanceWithCode(buffer.charCodeAt(this.#bufferIndex));
726 }
727 if (this.#bufferIndex >= bufferLen) {
728 this.#error("Unterminated quoted string in DOCTYPE declaration");
729 }
730 this.#advanceWithCode(buffer.charCodeAt(this.#bufferIndex));
731 return value;
732 }
733
734 // ========================================================================
735 // DEDICATED CAPTURE METHODS

Callers 1

processMethod · 0.95

Calls 2

#advanceWithCodeMethod · 0.95
#errorMethod · 0.95

Tested by

no test coverage detected