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

Method #readDoctypeQuotedString

xml/_tokenizer.ts:765–781  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

763
764 /** Read a quoted string in DOCTYPE. Does not handle cross-chunk boundaries. */
765 #readDoctypeQuotedString(): string {
766 const quote = this.#doctypeQuoteChar;
767 const buffer = this.#buffer;
768 const bufferLen = buffer.length;
769 let value = "";
770 while (
771 this.#bufferIndex < bufferLen && buffer[this.#bufferIndex] !== quote
772 ) {
773 value += buffer[this.#bufferIndex];
774 this.#advanceWithCode(buffer.charCodeAt(this.#bufferIndex));
775 }
776 if (this.#bufferIndex >= bufferLen) {
777 this.#error("Unterminated quoted string in DOCTYPE declaration");
778 }
779 this.#advanceWithCode(buffer.charCodeAt(this.#bufferIndex));
780 return value;
781 }
782
783 // ========================================================================
784 // DEDICATED CAPTURE METHODS

Callers 1

processMethod · 0.95

Calls 2

#advanceWithCodeMethod · 0.95
#errorMethod · 0.95

Tested by

no test coverage detected