taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

Parsing text ignore on root #38

Closed iliyaZelenko closed 4 years ago

iliyaZelenko commented 4 years ago

It seems you have a serious mistake in parsing.

Example code:

parse(`Катя, спасибо большое. Все наборы очень хороши. Самое то что нужно))) Прям хоть все скупай  <img src="/new_style/tiny_mce/plugins/emotions/img/big-1/big_smiles_162.gif" alt="big_smiles_162.gif" /><div></div>
`).toString()

Expected result:

Катя, спасибо большое. Все наборы очень хороши. Самое то что нужно))) Прям хоть все скупай  <img src="/new_style/tiny_mce/plugins/emotions/img/big-1/big_smiles_162.gif" alt="big_smiles_162.gif" /><div></div>

Actual result:

<img src="/new_style/tiny_mce/plugins/emotions/img/big-1/big_smiles_162.gif" alt="big_smiles_162.gif"  /><div></div>
taoqf commented 4 years ago

Indeed, but I tried and failed to fix this, I'm so sorry.

iliyaZelenko commented 4 years ago

@taoqf It’s a pity 😞, maybe because of this I will refuse this library, I will have to rewrite the code. Maybe there is some workaround? This will help a lot in our project.

taoqf commented 4 years ago

@iliyaZelenko Please try v1.2.15.

iliyaZelenko commented 4 years ago

Thanks, it works great! 😄