Skip to content
New issue

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

parser.on('text') sometimes gives text that isn't there #6

Open
mikeyfev1 opened this issue Aug 1, 2019 · 2 comments
Open

parser.on('text') sometimes gives text that isn't there #6

mikeyfev1 opened this issue Aug 1, 2019 · 2 comments

Comments

@mikeyfev1
Copy link

mikeyfev1 commented Aug 1, 2019

If you have the handler

parser.on('text', s => { console.log(s) }

and the parser encounters:

<description><![CDATA[<center><table><tr><th colspan='2' align='center'><em>Attributes</em></th></tr><tr bgcolor="#E3E3F3">
<th>ZCTA5CE10</th>
<td>36426</td>
</tr><tr bgcolor="">
<th>AFFGEOID10</th>
<td>8600000US36426</td>
</tr><tr bgcolor="#E3E3F3">
<th>GEOID10</th>
<td>36426</td>
</tr><tr bgcolor="">
<th>ALAND10</th>
<td>1258584220</td>
</tr><tr bgcolor="#E3E3F3">
<th>AWATER10</th>
<td>12694318</td>
</tr></table></center>]]></description>

You will a result string of the single character ">"

@rustam-starship
Copy link

rustam-starship commented Dec 16, 2022

Same here.
It looks like this

if (prev === ']' && c === ']') this._onCDATAEnd();
doesn't count last > from CDATA definition as end character thats why > character appears as text.

Does project still alive?

@rustam-starship
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants