Lines Matching +full:github +full:- +full:token
2 import type { Tokenizer, TokenHandler, Token } from 'parse5';
3 import { DevNullStream } from './dev-null-stream.js';
4 import { ParserFeedbackSimulator } from './parser-feedback-simulator.js';
10 * When enabled, each token will have a `sourceCodeLocation` property.
16 * Streaming [SAX](https://en.wikipedia.org/wiki/Simple_API_for_XML)-style HTML parser.
22 * const SAXParser = require('parse5-sax-parser');
66 // (see: https://github.com/inikulin/parse5/issues/97#issuecomment-171940774)
96 * const SAXParser = require('parse5-sax-parser');
130 onCharacter({ chars, location }: Token.CharacterToken): void {
153 onWhitespaceCharacter(token: Token.CharacterToken): void {
154 this.onCharacter(token);
158 onNullCharacter(token: Token.CharacterToken): void {
159 this.onCharacter(token);
169 onStartTag(token: Token.TagToken): void {
173 tagName: token.tagName,
174 attrs: token.attrs,
175 selfClosing: token.selfClosing,
176 sourceCodeLocation: token.location,
182 onEndTag(token: Token.TagToken): void {
186 tagName: token.tagName,
187 sourceCodeLocation: token.location,
193 onDoctype(token: Token.DoctypeToken): void {
197 name: token.name,
198 publicId: token.publicId,
199 systemId: token.systemId,
200 sourceCodeLocation: token.location,
206 onComment(token: Token.CommentToken): void {
210 text: token.data,
211 sourceCodeLocation: token.location,
216 protected emitIfListenerExists(eventName: string, token: SaxToken): boolean {
221 this._emitToken(eventName, token);
226 protected _emitToken(eventName: string, token: SaxToken): void {
227 this.emit(eventName, token);
240 sourceCodeLocation?: Token.Location | null;
247 attrs: Token.Attribute[];
248 /** Indicates if the tag is self-closing */