Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(xml/parser): CDataSection parsing
- Loading branch information
1 parent
9785bff
commit 1ad8a07
Showing
24 changed files
with
829 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ pub enum Token { | |
target: JsWord, | ||
data: JsWord, | ||
}, | ||
CData { | ||
Cdata { | ||
data: JsWord, | ||
raw: JsWord, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
crates/swc_xml_codegen/tests/fixture/cdata_section/input.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<root> | ||
<description>An example of escaped CENDs</description> | ||
<!-- This text contains a CEND ]]> --> | ||
<!-- In this first case we put the ]] at the end of the first CDATA block | ||
and the > in the second CDATA block --> | ||
<exampleOfACDATA> | ||
<![CDATA[ | ||
Since this is a CDATA section | ||
I can use all sorts of reserved characters | ||
but my document is still well formed! | ||
]]> | ||
</exampleOfACDATA> | ||
<p><![CDATA[<greeting>Hello, world!</greeting>]]></p> | ||
<p><![CDATA[content]]></p> | ||
<p><![CDATA[&ing]]></p> | ||
<p><![CDATA[&ing ]]]></p> | ||
<p><![CDATA[&ing]] ]]></p> | ||
<p><![CDATA[<message>text</message>]]></p> | ||
<p><![CDATA[</this is malformed!</malformed</malformed & worse>]]></p> | ||
<p><![CDATA[1]]><![CDATA[2]]></p> | ||
<p> | ||
<![CDATA[data]]> </p> | ||
<p><![CDATA[bracket ]after]]></p> | ||
<p><![CDATA[]]></p> | ||
</root> |
25 changes: 25 additions & 0 deletions
25
crates/swc_xml_codegen/tests/fixture/cdata_section/output.min.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<root> | ||
<description>An example of escaped CENDs</description> | ||
<!-- This text contains a CEND ]]> --> | ||
<!-- In this first case we put the ]] at the end of the first CDATA block | ||
and the > in the second CDATA block --> | ||
<exampleOfACDATA> | ||
<![CDATA[ | ||
Since this is a CDATA section | ||
I can use all sorts of reserved characters | ||
but my document is still well formed! | ||
]]> | ||
</exampleOfACDATA> | ||
<p><![CDATA[<greeting>Hello, world!</greeting>]]></p> | ||
<p><![CDATA[content]]></p> | ||
<p><![CDATA[&ing]]></p> | ||
<p><![CDATA[&ing ]]]></p> | ||
<p><![CDATA[&ing]] ]]></p> | ||
<p><![CDATA[<message>text</message>]]></p> | ||
<p><![CDATA[</this is malformed!</malformed</malformed & worse>]]></p> | ||
<p><![CDATA[1]]><![CDATA[2]]></p> | ||
<p> | ||
<![CDATA[data]]> </p> | ||
<p><![CDATA[bracket ]after]]></p> | ||
<p><![CDATA[]]></p> | ||
</root> |
25 changes: 25 additions & 0 deletions
25
crates/swc_xml_codegen/tests/fixture/cdata_section/output.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<root> | ||
<description>An example of escaped CENDs</description> | ||
<!-- This text contains a CEND ]]> --> | ||
<!-- In this first case we put the ]] at the end of the first CDATA block | ||
and the > in the second CDATA block --> | ||
<exampleOfACDATA> | ||
<![CDATA[ | ||
Since this is a CDATA section | ||
I can use all sorts of reserved characters | ||
but my document is still well formed! | ||
]]> | ||
</exampleOfACDATA> | ||
<p><![CDATA[<greeting>Hello, world!</greeting>]]></p> | ||
<p><![CDATA[content]]></p> | ||
<p><![CDATA[&ing]]></p> | ||
<p><![CDATA[&ing ]]]></p> | ||
<p><![CDATA[&ing]] ]]></p> | ||
<p><![CDATA[<message>text</message>]]></p> | ||
<p><![CDATA[</this is malformed!</malformed</malformed & worse>]]></p> | ||
<p><![CDATA[1]]><![CDATA[2]]></p> | ||
<p> | ||
<![CDATA[data]]> </p> | ||
<p><![CDATA[bracket ]after]]></p> | ||
<p><![CDATA[]]></p> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.