feat(html/parser): Add raw to comments (#5196)

This commit is contained in:
Alexander Akait 2022-07-14 07:56:31 +03:00 committed by GitHub
parent a27064623d
commit dead719550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
143 changed files with 878 additions and 237 deletions

View File

@ -102,4 +102,5 @@ pub struct Text {
pub struct Comment { pub struct Comment {
pub span: Span, pub span: Span,
pub data: JsWord, pub data: JsWord,
pub raw: Option<JsWord>,
} }

View File

@ -61,6 +61,7 @@ pub enum Token {
}, },
Comment { Comment {
data: JsWord, data: JsWord,
raw: JsWord,
}, },
Character { Character {
value: char, value: char,

View File

@ -326,6 +326,12 @@ fn verify_document_fragment(
struct DropSpan; struct DropSpan;
impl VisitMut for DropSpan { impl VisitMut for DropSpan {
fn visit_mut_comment(&mut self, n: &mut Comment) {
n.visit_mut_children_with(self);
n.raw = None;
}
fn visit_mut_text(&mut self, n: &mut Text) { fn visit_mut_text(&mut self, n: &mut Text) {
n.visit_mut_children_with(self); n.visit_mut_children_with(self);

View File

@ -132,6 +132,12 @@ struct Attribute {
raw_value: Option<String>, raw_value: Option<String>,
} }
#[derive(PartialEq, Eq, Clone, Debug)]
struct Comment {
data: String,
raw: String,
}
pub(crate) type LexResult<T> = Result<T, ErrorKind>; pub(crate) type LexResult<T> = Result<T, ErrorKind>;
// TODO improve `raw` for all tokens (linting + better codegen) // TODO improve `raw` for all tokens (linting + better codegen)
@ -151,7 +157,7 @@ where
last_start_tag_name: Option<JsWord>, last_start_tag_name: Option<JsWord>,
pending_tokens: VecDeque<TokenAndSpan>, pending_tokens: VecDeque<TokenAndSpan>,
current_doctype_token: Option<Doctype>, current_doctype_token: Option<Doctype>,
current_comment_token: Option<String>, current_comment_token: Option<Comment>,
current_tag_token: Option<Tag>, current_tag_token: Option<Tag>,
attribute_start_position: Option<BytePos>, attribute_start_position: Option<BytePos>,
character_reference_code: Option<Vec<(u8, u32, Option<char>)>>, character_reference_code: Option<Vec<(u8, u32, Option<char>)>>,
@ -756,37 +762,62 @@ where
} }
} }
fn create_comment_token(&mut self, new_data: Option<String>) { fn create_comment_token(&mut self, new_data: Option<String>, raw_start: &str) {
let mut data = String::with_capacity(32); let mut data = String::with_capacity(32);
let mut raw = String::with_capacity(38);
raw.push_str(raw_start);
if let Some(new_data) = new_data { if let Some(new_data) = new_data {
data.push_str(&new_data); data.push_str(&new_data);
raw.push_str(&new_data);
}; };
self.current_comment_token = Some(data); self.current_comment_token = Some(Comment { data, raw });
} }
fn append_to_comment_token(&mut self, c: char, _raw_c: Option<char>) { fn append_to_comment_token(&mut self, c: char, raw_c: char) {
if let Some(current_comment_token) = &mut self.current_comment_token { if let Some(Comment { data, raw }) = &mut self.current_comment_token {
let mut normalized_c = c; data.push(c);
let is_cr = c == '\r'; raw.push(raw_c);
if is_cr {
normalized_c = '\n';
if self.input.cur() == Some('\n') {
self.input.bump();
}
}
current_comment_token.push(normalized_c);
} }
} }
fn emit_comment_token(&mut self) { fn handle_raw_and_append_to_comment_token(&mut self, c: char) {
let data = self.current_comment_token.take().unwrap(); if let Some(Comment { data, raw }) = &mut self.current_comment_token {
let is_cr = c == '\r';
self.emit_token(Token::Comment { data: data.into() }); if is_cr {
let mut raw_c = String::with_capacity(2);
raw_c.push(c);
if self.input.cur() == Some('\n') {
self.input.bump();
raw_c.push('\n');
}
data.push('\n');
raw.push_str(&raw_c);
} else {
data.push(c);
raw.push(c);
}
}
}
fn emit_comment_token(&mut self, raw_end: Option<&str>) {
let mut comment = self.current_comment_token.take().unwrap();
if let Some(raw_end) = raw_end {
comment.raw.push_str(raw_end);
}
self.emit_token(Token::Comment {
data: comment.data.into(),
raw: comment.raw.into(),
});
} }
fn handle_raw_and_emit_character_token(&mut self, c: char) { fn handle_raw_and_emit_character_token(&mut self, c: char) {
@ -1035,7 +1066,7 @@ where
// bogus comment state. // bogus comment state.
Some('?') => { Some('?') => {
self.emit_error(ErrorKind::UnexpectedQuestionMarkInsteadOfTagName); self.emit_error(ErrorKind::UnexpectedQuestionMarkInsteadOfTagName);
self.create_comment_token(None); self.create_comment_token(None, "<");
self.reconsume_in_state(State::BogusComment); self.reconsume_in_state(State::BogusComment);
} }
// EOF // EOF
@ -1093,7 +1124,7 @@ where
// comment state. // comment state.
_ => { _ => {
self.emit_error(ErrorKind::InvalidFirstCharacterOfTagName); self.emit_error(ErrorKind::InvalidFirstCharacterOfTagName);
self.create_comment_token(None); self.create_comment_token(None, "</");
self.reconsume_in_state(State::BogusComment); self.reconsume_in_state(State::BogusComment);
} }
} }
@ -2517,12 +2548,12 @@ where
// Switch to the data state. Emit the current comment token. // Switch to the data state. Emit the current comment token.
Some('>') => { Some('>') => {
self.state = State::Data; self.state = State::Data;
self.emit_comment_token(); self.emit_comment_token(Some(">"));
} }
// EOF // EOF
// Emit the comment. Emit an end-of-file token. // Emit the comment. Emit an end-of-file token.
None => { None => {
self.emit_comment_token(); self.emit_comment_token(None);
self.emit_token(Token::Eof); self.emit_token(Token::Eof);
return Ok(()); return Ok(());
@ -2532,13 +2563,13 @@ where
// REPLACEMENT CHARACTER character to the comment token's data. // REPLACEMENT CHARACTER character to the comment token's data.
Some(c @ '\x00') => { Some(c @ '\x00') => {
self.emit_error(ErrorKind::UnexpectedNullCharacter); self.emit_error(ErrorKind::UnexpectedNullCharacter);
self.append_to_comment_token(REPLACEMENT_CHARACTER, Some(c)); self.append_to_comment_token(REPLACEMENT_CHARACTER, c);
} }
// Anything else // Anything else
// Append the current input character to the comment token's data. // Append the current input character to the comment token's data.
Some(c) => { Some(c) => {
self.validate_input_stream_character(c); self.validate_input_stream_character(c);
self.append_to_comment_token(c, Some(c)); self.handle_raw_and_append_to_comment_token(c);
} }
} }
} }
@ -2547,7 +2578,7 @@ where
let cur_pos = self.input.cur_pos(); let cur_pos = self.input.cur_pos();
let anything_else = |lexer: &mut Lexer<I>| { let anything_else = |lexer: &mut Lexer<I>| {
lexer.emit_error(ErrorKind::IncorrectlyOpenedComment); lexer.emit_error(ErrorKind::IncorrectlyOpenedComment);
lexer.create_comment_token(None); lexer.create_comment_token(None, "<!");
lexer.state = State::BogusComment; lexer.state = State::BogusComment;
lexer.cur_pos = cur_pos; lexer.cur_pos = cur_pos;
// We don't validate input here because we reset position // We don't validate input here because we reset position
@ -2561,7 +2592,7 @@ where
// is the empty string, and switch to the comment start state. // is the empty string, and switch to the comment start state.
Some('-') => match self.consume_next_char() { Some('-') => match self.consume_next_char() {
Some('-') => { Some('-') => {
self.create_comment_token(None); self.create_comment_token(None, "<!--");
self.state = State::CommentStart; self.state = State::CommentStart;
} }
_ => { _ => {
@ -2646,7 +2677,7 @@ where
data.push(a2); data.push(a2);
data.push('['); data.push('[');
self.create_comment_token(Some(data)); self.create_comment_token(Some(data), "<!");
self.state = State::BogusComment; self.state = State::BogusComment;
} }
} }
@ -2699,7 +2730,7 @@ where
Some('>') => { Some('>') => {
self.emit_error(ErrorKind::AbruptClosingOfEmptyComment); self.emit_error(ErrorKind::AbruptClosingOfEmptyComment);
self.state = State::Data; self.state = State::Data;
self.emit_comment_token(); self.emit_comment_token(Some(">"));
} }
// Anything else // Anything else
// Reconsume in the comment state. // Reconsume in the comment state.
@ -2723,14 +2754,14 @@ where
Some('>') => { Some('>') => {
self.emit_error(ErrorKind::AbruptClosingOfEmptyComment); self.emit_error(ErrorKind::AbruptClosingOfEmptyComment);
self.state = State::Data; self.state = State::Data;
self.emit_comment_token(); self.emit_comment_token(Some("->"));
} }
// EOF // EOF
// This is an eof-in-comment parse error. Emit the current comment token. // This is an eof-in-comment parse error. Emit the current comment token.
// Emit an end-of-file token. // Emit an end-of-file token.
None => { None => {
self.emit_error(ErrorKind::EofInComment); self.emit_error(ErrorKind::EofInComment);
self.emit_comment_token(); self.emit_comment_token(None);
self.emit_token(Token::Eof); self.emit_token(Token::Eof);
return Ok(()); return Ok(());
@ -2739,7 +2770,7 @@ where
// Append a U+002D HYPHEN-MINUS character (-) to the comment token's data. // Append a U+002D HYPHEN-MINUS character (-) to the comment token's data.
// Reconsume in the comment state. // Reconsume in the comment state.
_ => { _ => {
self.append_to_comment_token('-', None); self.append_to_comment_token('-', '-');
self.reconsume_in_state(State::Comment); self.reconsume_in_state(State::Comment);
} }
} }
@ -2752,7 +2783,7 @@ where
// Append the current input character to the comment token's data. Switch to // Append the current input character to the comment token's data. Switch to
// the comment less-than sign state. // the comment less-than sign state.
Some(c @ '<') => { Some(c @ '<') => {
self.append_to_comment_token(c, Some(c)); self.append_to_comment_token(c, c);
self.state = State::CommentLessThanSign; self.state = State::CommentLessThanSign;
} }
// U+002D HYPHEN-MINUS (-) // U+002D HYPHEN-MINUS (-)
@ -2765,14 +2796,14 @@ where
// REPLACEMENT CHARACTER character to the comment token's data. // REPLACEMENT CHARACTER character to the comment token's data.
Some(c @ '\x00') => { Some(c @ '\x00') => {
self.emit_error(ErrorKind::UnexpectedNullCharacter); self.emit_error(ErrorKind::UnexpectedNullCharacter);
self.append_to_comment_token(REPLACEMENT_CHARACTER, Some(c)); self.append_to_comment_token(REPLACEMENT_CHARACTER, c);
} }
// EOF // EOF
// This is an eof-in-comment parse error. Emit the current comment token. // This is an eof-in-comment parse error. Emit the current comment token.
// Emit an end-of-file token. // Emit an end-of-file token.
None => { None => {
self.emit_error(ErrorKind::EofInComment); self.emit_error(ErrorKind::EofInComment);
self.emit_comment_token(); self.emit_comment_token(None);
self.emit_token(Token::Eof); self.emit_token(Token::Eof);
return Ok(()); return Ok(());
@ -2781,7 +2812,7 @@ where
// Append the current input character to the comment token's data. // Append the current input character to the comment token's data.
Some(c) => { Some(c) => {
self.validate_input_stream_character(c); self.validate_input_stream_character(c);
self.append_to_comment_token(c, Some(c)); self.handle_raw_and_append_to_comment_token(c);
} }
} }
} }
@ -2793,13 +2824,13 @@ where
// Append the current input character to the comment token's data. Switch to // Append the current input character to the comment token's data. Switch to
// the comment less-than sign bang state. // the comment less-than sign bang state.
Some(c @ '!') => { Some(c @ '!') => {
self.append_to_comment_token(c, Some(c)); self.append_to_comment_token(c, c);
self.state = State::CommentLessThanSignBang; self.state = State::CommentLessThanSignBang;
} }
// U+003C LESS-THAN SIGN (<) // U+003C LESS-THAN SIGN (<)
// Append the current input character to the comment token's data. // Append the current input character to the comment token's data.
Some(c @ '<') => { Some(c @ '<') => {
self.append_to_comment_token(c, Some(c)); self.append_to_comment_token(c, c);
} }
// Anything else // Anything else
// Reconsume in the comment state. // Reconsume in the comment state.
@ -2872,7 +2903,7 @@ where
// Emit an end-of-file token. // Emit an end-of-file token.
None => { None => {
self.emit_error(ErrorKind::EofInComment); self.emit_error(ErrorKind::EofInComment);
self.emit_comment_token(); self.emit_comment_token(None);
self.emit_token(Token::Eof); self.emit_token(Token::Eof);
return Ok(()); return Ok(());
@ -2881,7 +2912,7 @@ where
// Append a U+002D HYPHEN-MINUS character (-) to the comment token's data. // Append a U+002D HYPHEN-MINUS character (-) to the comment token's data.
// Reconsume in the comment state. // Reconsume in the comment state.
_ => { _ => {
self.append_to_comment_token('-', None); self.append_to_comment_token('-', '-');
self.reconsume_in_state(State::Comment); self.reconsume_in_state(State::Comment);
} }
} }
@ -2894,7 +2925,7 @@ where
// Switch to the data state. Emit the current comment token. // Switch to the data state. Emit the current comment token.
Some('>') => { Some('>') => {
self.state = State::Data; self.state = State::Data;
self.emit_comment_token(); self.emit_comment_token(Some("-->"));
} }
// U+0021 EXCLAMATION MARK (!) // U+0021 EXCLAMATION MARK (!)
// Switch to the comment end bang state. // Switch to the comment end bang state.
@ -2904,14 +2935,14 @@ where
// U+002D HYPHEN-MINUS (-) // U+002D HYPHEN-MINUS (-)
// Append a U+002D HYPHEN-MINUS character (-) to the comment token's data. // Append a U+002D HYPHEN-MINUS character (-) to the comment token's data.
Some(c @ '-') => { Some(c @ '-') => {
self.append_to_comment_token(c, Some(c)); self.append_to_comment_token(c, c);
} }
// EOF // EOF
// This is an eof-in-comment parse error. Emit the current comment token. // This is an eof-in-comment parse error. Emit the current comment token.
// Emit an end-of-file token. // Emit an end-of-file token.
None => { None => {
self.emit_error(ErrorKind::EofInComment); self.emit_error(ErrorKind::EofInComment);
self.emit_comment_token(); self.emit_comment_token(None);
self.emit_token(Token::Eof); self.emit_token(Token::Eof);
return Ok(()); return Ok(());
@ -2920,8 +2951,8 @@ where
// Append two U+002D HYPHEN-MINUS characters (-) to the comment token's // Append two U+002D HYPHEN-MINUS characters (-) to the comment token's
// data. Reconsume in the comment state. // data. Reconsume in the comment state.
_ => { _ => {
self.append_to_comment_token('-', None); self.append_to_comment_token('-', '-');
self.append_to_comment_token('-', None); self.append_to_comment_token('-', '-');
self.reconsume_in_state(State::Comment); self.reconsume_in_state(State::Comment);
} }
} }
@ -2935,9 +2966,9 @@ where
// MARK character (!) to the comment token's data. Switch to the comment end // MARK character (!) to the comment token's data. Switch to the comment end
// dash state. // dash state.
Some(c @ '-') => { Some(c @ '-') => {
self.append_to_comment_token(c, Some(c)); self.append_to_comment_token(c, c);
self.append_to_comment_token('-', None); self.append_to_comment_token('-', '-');
self.append_to_comment_token('!', None); self.append_to_comment_token('!', '!');
self.state = State::CommentEndDash; self.state = State::CommentEndDash;
} }
// U+003E GREATER-THAN SIGN (>) // U+003E GREATER-THAN SIGN (>)
@ -2946,14 +2977,14 @@ where
Some('>') => { Some('>') => {
self.emit_error(ErrorKind::IncorrectlyClosedComment); self.emit_error(ErrorKind::IncorrectlyClosedComment);
self.state = State::Data; self.state = State::Data;
self.emit_comment_token(); self.emit_comment_token(Some(">"));
} }
// EOF // EOF
// This is an eof-in-comment parse error. Emit the current comment token. // This is an eof-in-comment parse error. Emit the current comment token.
// Emit an end-of-file token. // Emit an end-of-file token.
None => { None => {
self.emit_error(ErrorKind::EofInComment); self.emit_error(ErrorKind::EofInComment);
self.emit_comment_token(); self.emit_comment_token(None);
self.emit_token(Token::Eof); self.emit_token(Token::Eof);
return Ok(()); return Ok(());
@ -2963,9 +2994,9 @@ where
// MARK character (!) to the comment token's data. Reconsume in the comment // MARK character (!) to the comment token's data. Reconsume in the comment
// state. // state.
_ => { _ => {
self.append_to_comment_token('-', None); self.append_to_comment_token('-', '-');
self.append_to_comment_token('-', None); self.append_to_comment_token('-', '-');
self.append_to_comment_token('!', None); self.append_to_comment_token('!', '!');
self.reconsume_in_state(State::Comment); self.reconsume_in_state(State::Comment);
} }
} }

View File

@ -501,9 +501,10 @@ where
raw: Some(raw.take().into()), raw: Some(raw.take().into()),
}) })
} }
Data::Comment { data } => Child::Comment(Comment { Data::Comment { data, raw } => Child::Comment(Comment {
span: start_span, span: start_span,
data, data,
raw,
}), }),
_ => { _ => {
unreachable!(); unreachable!();
@ -8098,17 +8099,14 @@ where
// Create a Comment node whose data attribute is set to data and whose // Create a Comment node whose data attribute is set to data and whose
// node document is the same as that of the node in which the adjusted // node document is the same as that of the node in which the adjusted
// insertion location finds itself. // insertion location finds itself.
let comment = Node::new( let (data, raw) = match &token_and_info.token {
Data::Comment { Token::Comment { data, raw } => (data.clone(), Some(raw.clone())),
data: match &token_and_info.token { _ => {
Token::Comment { data } => data.clone(), unreachable!()
_ => { }
unreachable!() };
}
}, let comment = Node::new(Data::Comment { data, raw }, token_and_info.span);
},
token_and_info.span,
);
// Insert the newly created node at the adjusted insertion location. // Insert the newly created node at the adjusted insertion location.
self.insert_at_position(adjusted_insertion_location, comment); self.insert_at_position(adjusted_insertion_location, comment);
@ -8120,17 +8118,14 @@ where
&mut self, &mut self,
token_and_info: &mut TokenAndInfo, token_and_info: &mut TokenAndInfo,
) -> PResult<()> { ) -> PResult<()> {
let comment = Node::new( let (data, raw) = match &token_and_info.token {
Data::Comment { Token::Comment { data, raw } => (data.clone(), Some(raw.clone())),
data: match &token_and_info.token { _ => {
Token::Comment { data } => data.clone(), unreachable!()
_ => { }
unreachable!() };
}
}, let comment = Node::new(Data::Comment { data, raw }, token_and_info.span);
},
token_and_info.span,
);
if let Some(document) = &self.document { if let Some(document) = &self.document {
self.append_node(document, comment); self.append_node(document, comment);
@ -8143,17 +8138,14 @@ where
&mut self, &mut self,
token_and_info: &mut TokenAndInfo, token_and_info: &mut TokenAndInfo,
) -> PResult<()> { ) -> PResult<()> {
let comment = Node::new( let (data, raw) = match &token_and_info.token {
Data::Comment { Token::Comment { data, raw } => (data.clone(), Some(raw.clone())),
data: match &token_and_info.token { _ => {
Token::Comment { data } => data.clone(), unreachable!()
_ => { }
unreachable!() };
}
}, let comment = Node::new(Data::Comment { data, raw }, token_and_info.span);
},
token_and_info.span,
);
if let Some(html) = &self.open_elements_stack.items.get(0) { if let Some(html) = &self.open_elements_stack.items.get(0) {
self.append_node(html, comment); self.append_node(html, comment);

View File

@ -37,6 +37,7 @@ pub enum Data {
}, },
Comment { Comment {
data: JsWord, data: JsWord,
raw: Option<JsWord>,
}, },
} }

View File

@ -7,7 +7,7 @@
use std::{fs, mem::take, path::PathBuf}; use std::{fs, mem::take, path::PathBuf};
use serde_json::Value; use serde_json::Value;
use swc_atoms::JsWord; use swc_atoms::{js_word, JsWord};
use swc_common::{ use swc_common::{
collections::AHashSet, collections::AHashSet,
errors::Handler, errors::Handler,
@ -647,6 +647,9 @@ fn html5lib_test_tokenizer(input: PathBuf) {
Token::Character { ref mut raw, .. } => { Token::Character { ref mut raw, .. } => {
*raw = None; *raw = None;
} }
Token::Comment { ref mut raw, .. } => {
*raw = js_word!("");
}
_ => {} _ => {}
} }
@ -793,7 +796,10 @@ fn html5lib_test_tokenizer(input: PathBuf) {
}; };
} }
vec![Token::Comment { data: data.into() }] vec![Token::Comment {
data: data.into(),
raw: js_word!(""),
}]
} }
_ => { _ => {
unreachable!("unknown token {}", token_parts[0]) unreachable!("unknown token {}", token_parts[0])

View File

@ -279,7 +279,8 @@
"end": 336, "end": 336,
"ctxt": 0 "ctxt": 0
}, },
"data": " Test " "data": " Test ",
"raw": "<!-- Test -->"
} }
], ],
"content": null, "content": null,

View File

@ -71,7 +71,8 @@
"end": 56, "end": 56,
"ctxt": 0 "ctxt": 0
}, },
"data": "This is a comment" "data": "This is a comment",
"raw": "<!--This is a comment-->"
}, },
{ {
"type": "Text", "type": "Text",
@ -90,7 +91,8 @@
"end": 83, "end": 83,
"ctxt": 0 "ctxt": 0
}, },
"data": " This is a comment " "data": " This is a comment ",
"raw": "<!-- This is a comment -->"
}, },
{ {
"type": "Text", "type": "Text",
@ -144,7 +146,8 @@
"end": 162, "end": 162,
"ctxt": 0 "ctxt": 0
}, },
"data": " Comments are not displayed in the browser " "data": " Comments are not displayed in the browser ",
"raw": "<!-- Comments are not displayed in the browser -->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -140,7 +140,8 @@
"end": 97, "end": 97,
"ctxt": 0 "ctxt": 0
}, },
"data": " test " "data": " test ",
"raw": "<!-- test -->"
}, },
{ {
"type": "Text", "type": "Text",
@ -159,7 +160,8 @@
"end": 111, "end": 111,
"ctxt": 0 "ctxt": 0
}, },
"data": " foo " "data": " foo ",
"raw": "<!-- foo -->"
}, },
{ {
"type": "Element", "type": "Element",
@ -193,7 +195,8 @@
"end": 142, "end": 142,
"ctxt": 0 "ctxt": 0
}, },
"data": " bar\n\nmoo " "data": " bar\n\nmoo ",
"raw": "<!-- bar\n\nmoo -->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -71,7 +71,8 @@
"end": 74, "end": 74,
"ctxt": 0 "ctxt": 0
}, },
"data": "[if IE 5]>This is IE 5<br><![endif]" "data": "[if IE 5]>This is IE 5<br><![endif]",
"raw": "<!--[if IE 5]>This is IE 5<br><![endif]-->"
}, },
{ {
"type": "Text", "type": "Text",
@ -90,7 +91,8 @@
"end": 117, "end": 117,
"ctxt": 0 "ctxt": 0
}, },
"data": "[if IE 6]>This is IE 6<br><![endif]" "data": "[if IE 6]>This is IE 6<br><![endif]",
"raw": "<!--[if IE 6]>This is IE 6<br><![endif]-->"
}, },
{ {
"type": "Text", "type": "Text",
@ -109,7 +111,8 @@
"end": 160, "end": 160,
"ctxt": 0 "ctxt": 0
}, },
"data": "[if IE 7]>This is IE 7<br><![endif]" "data": "[if IE 7]>This is IE 7<br><![endif]",
"raw": "<!--[if IE 7]>This is IE 7<br><![endif]-->"
}, },
{ {
"type": "Text", "type": "Text",
@ -128,7 +131,8 @@
"end": 203, "end": 203,
"ctxt": 0 "ctxt": 0
}, },
"data": "[if IE 8]>This is IE 8<br><![endif]" "data": "[if IE 8]>This is IE 8<br><![endif]",
"raw": "<!--[if IE 8]>This is IE 8<br><![endif]-->"
}, },
{ {
"type": "Text", "type": "Text",
@ -147,7 +151,8 @@
"end": 246, "end": 246,
"ctxt": 0 "ctxt": 0
}, },
"data": "[if IE 9]>This is IE 9<br><![endif]" "data": "[if IE 9]>This is IE 9<br><![endif]",
"raw": "<!--[if IE 9]>This is IE 9<br><![endif]-->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -106,7 +106,8 @@
"end": 151, "end": 151,
"ctxt": 0 "ctxt": 0
}, },
"data": "\n<p>Look at this cool image:</p>\n<img border=\"0\" src=\"pic_trulli.jpg\" alt=\"Trulli\">\n" "data": "\n<p>Look at this cool image:</p>\n<img border=\"0\" src=\"pic_trulli.jpg\" alt=\"Trulli\">\n",
"raw": "<!--\n<p>Look at this cool image:</p>\n<img border=\"0\" src=\"pic_trulli.jpg\" alt=\"Trulli\">\n-->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -1234,7 +1234,8 @@
"end": 954, "end": 954,
"ctxt": 0 "ctxt": 0
}, },
"data": " Presentation MathML " "data": " Presentation MathML ",
"raw": "<!-- Presentation MathML -->"
}, },
{ {
"type": "Text", "type": "Text",
@ -1463,7 +1464,8 @@
"end": 1157, "end": 1157,
"ctxt": 0 "ctxt": 0
}, },
"data": " Content MathML " "data": " Content MathML ",
"raw": "<!-- Content MathML -->"
}, },
{ {
"type": "Text", "type": "Text",
@ -1766,7 +1768,8 @@
"end": 1517, "end": 1517,
"ctxt": 0 "ctxt": 0
}, },
"data": " annotate an image " "data": " annotate an image ",
"raw": "<!-- annotate an image -->"
}, },
{ {
"type": "Text", "type": "Text",
@ -1834,7 +1837,8 @@
"end": 1619, "end": 1619,
"ctxt": 0 "ctxt": 0
}, },
"data": " annotate TeX " "data": " annotate TeX ",
"raw": "<!-- annotate TeX -->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -161,7 +161,8 @@
"end": 135, "end": 135,
"ctxt": 0 "ctxt": 0
}, },
"data": " anchor linking to external file " "data": " anchor linking to external file ",
"raw": "<!-- anchor linking to external file -->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -2286,7 +2286,8 @@
"end": 3255, "end": 3255,
"ctxt": 0 "ctxt": 0
}, },
"data": " Common use case: embed HTML text into SVG " "data": " Common use case: embed HTML text into SVG ",
"raw": "<!-- Common use case: embed HTML text into SVG -->"
}, },
{ {
"type": "Text", "type": "Text",
@ -2375,7 +2376,8 @@
"end": 3513, "end": 3513,
"ctxt": 0 "ctxt": 0
}, },
"data": "\n In the context of SVG embedded in an HTML document, the XHTML\n namespace could be omitted, but it is mandatory in the\n context of an SVG document\n " "data": "\n In the context of SVG embedded in an HTML document, the XHTML\n namespace could be omitted, but it is mandatory in the\n context of an SVG document\n ",
"raw": "<!--\n In the context of SVG embedded in an HTML document, the XHTML\n namespace could be omitted, but it is mandatory in the\n context of an SVG document\n -->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -60,7 +60,8 @@
"end": 16, "end": 16,
"ctxt": 0 "ctxt": 0
}, },
"data": " BAR " "data": " BAR ",
"raw": "<!-- BAR -->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -60,7 +60,8 @@
"end": 17, "end": 17,
"ctxt": 0 "ctxt": 0
}, },
"data": " BAR " "data": " BAR ",
"raw": "<!-- BAR >"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -60,7 +60,8 @@
"end": 9, "end": 9,
"ctxt": 0 "ctxt": 0
}, },
"data": "" "data": "",
"raw": "<!-->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -14,7 +14,8 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"data": "?xml version=\"1.0\"" "data": "?xml version=\"1.0\"",
"raw": "<?xml version=\"1.0\">"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"data": "?xml version=\"1.0\"" "data": "?xml version=\"1.0\"",
"raw": "<?xml version=\"1.0\">"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 14, "end": 14,
"ctxt": 0 "ctxt": 0
}, },
"data": "?xml version" "data": "?xml version",
"raw": "<?xml version"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -60,7 +60,8 @@
"end": 12, "end": 12,
"ctxt": 0 "ctxt": 0
}, },
"data": "-" "data": "-",
"raw": "<!----->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -25,7 +25,8 @@
"end": 23, "end": 23,
"ctxt": 0 "ctxt": 0
}, },
"data": " comment " "data": " comment ",
"raw": "<!-- comment -->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -60,7 +60,8 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"data": " BAR --! >BAZ" "data": " BAR --! >BAZ",
"raw": "<!-- BAR --! >BAZ"
} }
], ],
"content": null, "content": null,

View File

@ -60,7 +60,8 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"data": " BAR --!\n>BAZ" "data": " BAR --!\n>BAZ",
"raw": "<!-- BAR --!\n>BAZ"
} }
], ],
"content": null, "content": null,

View File

@ -60,7 +60,8 @@
"end": 22, "end": 22,
"ctxt": 0 "ctxt": 0
}, },
"data": " BAR -- >BAZ" "data": " BAR -- >BAZ",
"raw": "<!-- BAR -- >BAZ"
} }
], ],
"content": null, "content": null,

View File

@ -60,7 +60,8 @@
"end": 32, "end": 32,
"ctxt": 0 "ctxt": 0
}, },
"data": " BAR -- <QUX> -- MUX " "data": " BAR -- <QUX> -- MUX ",
"raw": "<!-- BAR -- <QUX> -- MUX -->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -60,7 +60,8 @@
"end": 33, "end": 33,
"ctxt": 0 "ctxt": 0
}, },
"data": " BAR -- <QUX> -- MUX " "data": " BAR -- <QUX> -- MUX ",
"raw": "<!-- BAR -- <QUX> -- MUX >"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -60,7 +60,8 @@
"end": 36, "end": 36,
"ctxt": 0 "ctxt": 0
}, },
"data": " BAR -- <QUX> -- MUX -- >BAZ" "data": " BAR -- <QUX> -- MUX -- >BAZ",
"raw": "<!-- BAR -- <QUX> -- MUX -- >BAZ"
} }
], ],
"content": null, "content": null,

View File

@ -60,7 +60,8 @@
"end": 11, "end": 11,
"ctxt": 0 "ctxt": 0
}, },
"data": "" "data": "",
"raw": "<!---->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -60,7 +60,8 @@
"end": 10, "end": 10,
"ctxt": 0 "ctxt": 0
}, },
"data": "" "data": "",
"raw": "<!--->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -72,7 +72,8 @@
"end": 29, "end": 29,
"ctxt": 0 "ctxt": 0
}, },
"data": "test" "data": "test",
"raw": "<!--test-->"
} }
], ],
"content": null, "content": null,

View File

@ -61,7 +61,8 @@
"end": 20, "end": 20,
"ctxt": 0 "ctxt": 0
}, },
"data": "test" "data": "test",
"raw": "<!--test-->"
} }
], ],
"content": null, "content": null,

View File

@ -14,7 +14,8 @@
"end": 48, "end": 48,
"ctxt": 0 "ctxt": 0
}, },
"data": "?import namespace=\"foo\" implementation=\"#bar\"" "data": "?import namespace=\"foo\" implementation=\"#bar\"",
"raw": "<?import namespace=\"foo\" implementation=\"#bar\">"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 16, "end": 16,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo--bar" "data": "foo--bar",
"raw": "<!--foo--bar-->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 14, "end": 14,
"ctxt": 0 "ctxt": 0
}, },
"data": "[CDATA[x]]" "data": "[CDATA[x]]",
"raw": "<![CDATA[x]]>"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -47,7 +47,8 @@
"end": 42, "end": 42,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -60,7 +60,8 @@
"end": 45, "end": 45,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -79,7 +79,8 @@
"end": 32, "end": 32,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -47,7 +47,8 @@
"end": 45, "end": 45,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -47,7 +47,8 @@
"end": 49, "end": 49,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -47,7 +47,8 @@
"end": 31, "end": 31,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -76,7 +76,8 @@
"end": 30, "end": 30,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -75,7 +75,8 @@
"end": 30, "end": 30,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -47,7 +47,8 @@
"end": 27, "end": 27,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -61,7 +61,8 @@
"end": 37, "end": 37,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -61,7 +61,8 @@
"end": 36, "end": 36,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -61,7 +61,8 @@
"end": 33, "end": 33,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -61,7 +61,8 @@
"end": 33, "end": 33,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -50,7 +50,8 @@
"end": 11, "end": 11,
"ctxt": 0 "ctxt": 0
}, },
"data": "<22>" "data": "<22>",
"raw": "<!\u0000>"
} }
], ],
"content": null, "content": null,

View File

@ -50,7 +50,8 @@
"end": 22, "end": 22,
"ctxt": 0 "ctxt": 0
}, },
"data": "<22>filler<65>text" "data": "<22>filler<65>text",
"raw": "<!\u0000filler\u0000text>"
} }
], ],
"content": null, "content": null,

View File

@ -69,7 +69,8 @@
"end": 31, "end": 31,
"ctxt": 0 "ctxt": 0
}, },
"data": "comment" "data": "comment",
"raw": "<!--comment-->"
} }
] ]
}, },

View File

@ -75,7 +75,8 @@
"end": 40, "end": 40,
"ctxt": 0 "ctxt": 0
}, },
"data": "[CDATA[a]]" "data": "[CDATA[a]]",
"raw": "<![CDATA[a]]>"
} }
], ],
"content": null, "content": null,

View File

@ -57,7 +57,8 @@
"end": 26, "end": 26,
"ctxt": 0 "ctxt": 0
}, },
"data": " foo " "data": " foo ",
"raw": "<!-- foo -->"
} }
] ]
} }

View File

@ -61,7 +61,8 @@
"end": 31, "end": 31,
"ctxt": 0 "ctxt": 0
}, },
"data": " " "data": " ",
"raw": "<!-- -->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -61,7 +61,8 @@
"end": 41, "end": 41,
"ctxt": 0 "ctxt": 0
}, },
"data": " " "data": " ",
"raw": "<!-- -->"
} }
], ],
"content": null, "content": null,

View File

@ -47,7 +47,8 @@
"end": 39, "end": 39,
"ctxt": 0 "ctxt": 0
}, },
"data": "<noscript></noscript>" "data": "<noscript></noscript>",
"raw": "<!--<noscript></noscript>-->"
} }
], ],
"content": null, "content": null,

View File

@ -47,7 +47,8 @@
"end": 40, "end": 40,
"ctxt": 0 "ctxt": 0
}, },
"data": "</noscript>X<noscript>" "data": "</noscript>X<noscript>",
"raw": "<!--</noscript>X<noscript>-->"
} }
], ],
"content": null, "content": null,

View File

@ -72,7 +72,8 @@
"end": 46, "end": 46,
"ctxt": 0 "ctxt": 0
}, },
"data": " " "data": " ",
"raw": "<!-- -->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -72,7 +72,8 @@
"end": 56, "end": 56,
"ctxt": 0 "ctxt": 0
}, },
"data": " " "data": " ",
"raw": "<!-- -->"
} }
], ],
"content": null, "content": null,

View File

@ -58,7 +58,8 @@
"end": 54, "end": 54,
"ctxt": 0 "ctxt": 0
}, },
"data": "<noscript></noscript>" "data": "<noscript></noscript>",
"raw": "<!--<noscript></noscript>-->"
} }
], ],
"content": null, "content": null,

View File

@ -58,7 +58,8 @@
"end": 55, "end": 55,
"ctxt": 0 "ctxt": 0
}, },
"data": "</noscript>X<noscript>" "data": "</noscript>X<noscript>",
"raw": "<!--</noscript>X<noscript>-->"
} }
], ],
"content": null, "content": null,

View File

@ -89,7 +89,8 @@
"end": 71, "end": 71,
"ctxt": 0 "ctxt": 0
}, },
"data": "abc" "data": "abc",
"raw": "<!--abc-->"
} }
], ],
"content": null, "content": null,

View File

@ -93,7 +93,8 @@
"end": 78, "end": 78,
"ctxt": 0 "ctxt": 0
}, },
"data": "abc" "data": "abc",
"raw": "<!--abc-->"
} }
] ]
} }

View File

@ -36,7 +36,8 @@
"end": 36, "end": 36,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -50,7 +50,8 @@
"end": 43, "end": 43,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -79,7 +79,8 @@
"end": 38, "end": 38,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -82,7 +82,8 @@
"end": 36, "end": 36,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -82,7 +82,8 @@
"end": 35, "end": 35,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -82,7 +82,8 @@
"end": 36, "end": 36,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -68,7 +68,8 @@
"end": 60, "end": 60,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
] ]
} }

View File

@ -47,7 +47,8 @@
"end": 541, "end": 541,
"ctxt": 0 "ctxt": 0
}, },
"data": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "data": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"raw": "<!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 6, "end": 6,
"ctxt": 0 "ctxt": 0
}, },
"data": "" "data": "",
"raw": "<!-->"
}, },
{ {
"type": "Element", "type": "Element",
@ -80,7 +81,8 @@
"end": 18, "end": 18,
"ctxt": 0 "ctxt": 0
}, },
"data": "" "data": "",
"raw": "<!-->"
} }
], ],
"content": null, "content": null,

View File

@ -14,7 +14,8 @@
"end": 9, "end": 9,
"ctxt": 0 "ctxt": 0
}, },
"data": "-" "data": "-",
"raw": "<!----->"
}, },
{ {
"type": "Element", "type": "Element",
@ -193,7 +194,8 @@
"end": 72, "end": 72,
"ctxt": 0 "ctxt": 0
}, },
"data": "X" "data": "X",
"raw": "<!--X-->"
} }
], ],
"content": null, "content": null,

View File

@ -175,7 +175,8 @@
"end": 71, "end": 71,
"ctxt": 0 "ctxt": 0
}, },
"data": "do" "data": "do",
"raw": "<!--do-->"
} }
], ],
"content": null, "content": null,

View File

@ -14,7 +14,8 @@
"end": 4, "end": 4,
"ctxt": 0 "ctxt": 0
}, },
"data": "#" "data": "#",
"raw": "</#"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 3, "end": 3,
"ctxt": 0 "ctxt": 0
}, },
"data": "?" "data": "?",
"raw": "<?"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 4, "end": 4,
"ctxt": 0 "ctxt": 0
}, },
"data": "?#" "data": "?#",
"raw": "<?#"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 3, "end": 3,
"ctxt": 0 "ctxt": 0
}, },
"data": "" "data": "",
"raw": "<!"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 4, "end": 4,
"ctxt": 0 "ctxt": 0
}, },
"data": "#" "data": "#",
"raw": "<!#"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 12, "end": 12,
"ctxt": 0 "ctxt": 0
}, },
"data": "?COMMENT?" "data": "?COMMENT?",
"raw": "<?COMMENT?>"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 11, "end": 11,
"ctxt": 0 "ctxt": 0
}, },
"data": "COMMENT" "data": "COMMENT",
"raw": "<!COMMENT>"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 13, "end": 13,
"ctxt": 0 "ctxt": 0
}, },
"data": " COMMENT " "data": " COMMENT ",
"raw": "</ COMMENT >"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 14, "end": 14,
"ctxt": 0 "ctxt": 0
}, },
"data": "?COM--MENT?" "data": "?COM--MENT?",
"raw": "<?COM--MENT?>"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 13, "end": 13,
"ctxt": 0 "ctxt": 0
}, },
"data": "COM--MENT" "data": "COM--MENT",
"raw": "<!COM--MENT>"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -14,7 +14,8 @@
"end": 15, "end": 15,
"ctxt": 0 "ctxt": 0
}, },
"data": " COM--MENT " "data": " COM--MENT ",
"raw": "</ COM--MENT >"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -72,7 +72,8 @@
"end": 33, "end": 33,
"ctxt": 0 "ctxt": 0
}, },
"data": "foo" "data": "foo",
"raw": "<!--foo-->"
} }
], ],
"content": null, "content": null,

View File

@ -83,7 +83,8 @@
"end": 41, "end": 41,
"ctxt": 0 "ctxt": 0
}, },
"data": "[CDATA[foo]]" "data": "[CDATA[foo]]",
"raw": "<![CDATA[foo]]>"
} }
], ],
"content": null, "content": null,

View File

@ -61,7 +61,8 @@
"end": 21, "end": 21,
"ctxt": 0 "ctxt": 0
}, },
"data": "[CDATA[foo]]" "data": "[CDATA[foo]]",
"raw": "<![CDATA[foo]]>"
} }
], ],
"content": null, "content": null,

View File

@ -71,7 +71,8 @@
"end": 34, "end": 34,
"ctxt": 0 "ctxt": 0
}, },
"data": "path" "data": "path",
"raw": "<!--path-->"
} }
], ],
"content": null, "content": null,

View File

@ -72,7 +72,8 @@
"end": 34, "end": 34,
"ctxt": 0 "ctxt": 0
}, },
"data": "/div" "data": "/div",
"raw": "<!/div>"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -25,7 +25,8 @@
"end": 22, "end": 22,
"ctxt": 0 "ctxt": 0
}, },
"data": " X" "data": " X",
"raw": "<!-- X"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -25,7 +25,8 @@
"end": 34, "end": 34,
"ctxt": 0 "ctxt": 0
}, },
"data": " XXX - XXX " "data": " XXX - XXX ",
"raw": "<!-- XXX - XXX -->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -25,7 +25,8 @@
"end": 30, "end": 30,
"ctxt": 0 "ctxt": 0
}, },
"data": " XXX - XXX" "data": " XXX - XXX",
"raw": "<!-- XXX - XXX"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -25,7 +25,8 @@
"end": 40, "end": 40,
"ctxt": 0 "ctxt": 0
}, },
"data": " XXX - XXX - XXX " "data": " XXX - XXX - XXX ",
"raw": "<!-- XXX - XXX - XXX -->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -25,7 +25,8 @@
"end": 23, "end": 23,
"ctxt": 0 "ctxt": 0
}, },
"data": "x" "data": "x",
"raw": "<!--x"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -71,7 +71,8 @@
"end": 39, "end": 39,
"ctxt": 0 "ctxt": 0
}, },
"data": "<!--x" "data": "<!--x",
"raw": "<!--<!--x-->"
}, },
{ {
"type": "Text", "type": "Text",

View File

@ -68,7 +68,8 @@
"end": 22, "end": 22,
"ctxt": 0 "ctxt": 0
}, },
"data": " " "data": " ",
"raw": "<!-- -->"
}, },
{ {
"type": "Comment", "type": "Comment",
@ -77,7 +78,8 @@
"end": 45, "end": 45,
"ctxt": 0 "ctxt": 0
}, },
"data": " " "data": " ",
"raw": "<!-- -->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -39,7 +39,8 @@
"end": 22, "end": 22,
"ctxt": 0 "ctxt": 0
}, },
"data": " " "data": " ",
"raw": "<!-- -->"
}, },
{ {
"type": "Element", "type": "Element",
@ -83,7 +84,8 @@
"end": 46, "end": 46,
"ctxt": 0 "ctxt": 0
}, },
"data": " " "data": " ",
"raw": "<!-- -->"
}, },
{ {
"type": "Element", "type": "Element",

View File

@ -47,7 +47,8 @@
"end": 29, "end": 29,
"ctxt": 0 "ctxt": 0
}, },
"data": "</noscript>" "data": "</noscript>",
"raw": "<!--</noscript>-->"
} }
], ],
"content": null, "content": null,

Some files were not shown because too many files have changed in this diff Show More