We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I find some error with following code:
var HTML5 = require('html5') var p = new HTML5.Parser(); HTML5.enableDebug('tokenizer.token') var str = '<!DOCTYPE html>\n' + '<html> \n'+ '<body>\n'+ '<script>\n' + 'var a = 1;\n' + '</script>\n' + '<a href="#">top</a>\n' p.parse(str);
The output is:
DEBUG: 'tokenizer.token' { type: 'Doctype', name: 'html', publicId: null, systemId: null, correct: true } DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' } DEBUG: 'tokenizer.token' { type: 'StartTag', name: 'html', data: [] } DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: ' ' } DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: ' ' } DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' } DEBUG: 'tokenizer.token' { type: 'StartTag', name: 'body', data: [] } DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' } DEBUG: 'tokenizer.token' { type: 'Characters', data: undefined } DEBUG: 'tokenizer.token' { type: 'StartTag', name: 'script', data: [] } DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' } DEBUG: 'tokenizer.token' { type: 'Characters', data: 'var a = 1;\n' } DEBUG: 'tokenizer.token' { type: 'Characters', data: 'var a = 1;\n' } DEBUG: 'tokenizer.token' { type: 'EndTag', name: 'script', data: [] } DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' } DEBUG: 'tokenizer.token' { type: 'StartTag', name: 'a', data: [ { nodeName: 'href', nodeValue: '#' } ] } DEBUG: 'tokenizer.token' { type: 'Characters', data: 'top' } DEBUG: 'tokenizer.token' { type: 'EndTag', name: 'a', data: [] } DEBUG: 'tokenizer.token' { type: 'EOF', data: 'End of File' }
The token give me { type: 'Characters', data: undefined } after { type: 'StartTag', name: 'body', data: [] } which is wrong.
The text was updated successfully, but these errors were encountered:
9bb5165
No branches or pull requests
I find some error with following code:
var HTML5 = require('html5')
var p = new HTML5.Parser();
HTML5.enableDebug('tokenizer.token')
var str = '<!DOCTYPE html>\n' +
'<html> \n'+
'<body>\n'+
'<script>\n' +
'var a = 1;\n' +
'</script>\n' +
'<a href="#">top</a>\n'
p.parse(str);
The output is:
DEBUG: 'tokenizer.token' { type: 'Doctype',
name: 'html',
publicId: null,
systemId: null,
correct: true }
DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' }
DEBUG: 'tokenizer.token' { type: 'StartTag', name: 'html', data: [] }
DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: ' ' }
DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: ' ' }
DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' }
DEBUG: 'tokenizer.token' { type: 'StartTag', name: 'body', data: [] }
DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' }
DEBUG: 'tokenizer.token' { type: 'Characters', data: undefined }
DEBUG: 'tokenizer.token' { type: 'StartTag', name: 'script', data: [] }
DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' }
DEBUG: 'tokenizer.token' { type: 'Characters', data: 'var a = 1;\n' }
DEBUG: 'tokenizer.token' { type: 'Characters', data: 'var a = 1;\n' }
DEBUG: 'tokenizer.token' { type: 'EndTag', name: 'script', data: [] }
DEBUG: 'tokenizer.token' { type: 'SpaceCharacters', data: '\n' }
DEBUG: 'tokenizer.token' { type: 'StartTag',
name: 'a',
data: [ { nodeName: 'href', nodeValue: '#' } ] }
DEBUG: 'tokenizer.token' { type: 'Characters', data: 'top' }
DEBUG: 'tokenizer.token' { type: 'EndTag', name: 'a', data: [] }
DEBUG: 'tokenizer.token' { type: 'EOF', data: 'End of File' }
The token give me { type: 'Characters', data: undefined } after { type: 'StartTag', name: 'body', data: [] } which is wrong.
The text was updated successfully, but these errors were encountered: