-
-
Save subbuss/51b7a850b2b5cb3f3579 to your computer and use it in GitHub Desktop.
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
[subbu@earth tests] echo "<b>foo</b><i>bar</i>" | node parse.js --trace html | |
---- <chunk> ---- | |
T:html: {"type":"TagTk","name":"p","attribs":[],"dataAttribs":{}} | |
T:html: {"type":"TagTk","name":"b","attribs":[],"dataAttribs":{"tsr":[0,3],"stx":"html"}} | |
T:html: "foo" | |
T:html: {"type":"EndTagTk","name":"b","attribs":[],"dataAttribs":{"tsr":[6,10],"stx":"html"}} | |
T:html: {"type":"TagTk","name":"i","attribs":[],"dataAttribs":{"tsr":[10,13],"stx":"html"}} | |
T:html: "bar" | |
T:html: {"type":"EndTagTk","name":"i","attribs":[],"dataAttribs":{"tsr":[16,20],"stx":"html"}} | |
T:html: {"type":"EndTagTk","name":"p","attribs":[],"dataAttribs":{}} | |
T:html: {"type":"NlTk","dataAttribs":{}} | |
T:html: {"type":"EOFTk"} | |
---- </chunk> ---- | |
<p data-parsoid="{"dsr":[0,20]}"><b data-parsoid="{"tsr":[0,3],"stx":"html","dsr":[0,10]}">foo</b><i data-parsoid="{"tsr":[10,13],"stx":"html","dsr":[10,20]}">bar</i></p> | |
[subbu@earth tests] echo "<B>foo</B><I>bar</I>" | node parse.js --trace html | |
---- <chunk> ---- | |
T:html: {"type":"TagTk","name":"p","attribs":[],"dataAttribs":{}} | |
T:html: {"type":"TagTk","name":"B","attribs":[],"dataAttribs":{"tsr":[0,3],"stx":"html"}} | |
T:html: "foo" | |
T:html: {"type":"EndTagTk","name":"B","attribs":[],"dataAttribs":{"tsr":[6,10],"stx":"html"}} | |
T:html: {"type":"TagTk","name":"I","attribs":[],"dataAttribs":{"tsr":[10,13],"stx":"html"}} | |
T:html: "bar" | |
T:html: {"type":"EndTagTk","name":"I","attribs":[],"dataAttribs":{"tsr":[16,20],"stx":"html"}} | |
T:html: {"type":"EndTagTk","name":"p","attribs":[],"dataAttribs":{}} | |
T:html: {"type":"NlTk","dataAttribs":{}} | |
T:html: {"type":"EOFTk"} | |
---- </chunk> ---- | |
<p data-parsoid="{"dsr":[0,20]}"><b data-parsoid="{"tsr":[0,3],"stx":"html","autoInsertedEnd":true,"dsr":[0,20]}">foo<i data-parsoid="{"tsr":[10,13],"stx":"html","autoInsertedEnd":true,"dsr":[10,null]}">bar</i></b></p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment