qzwbqkz / ganon

Automatically exported from code.google.com/p/ganon
0 stars 0 forks source link

0 as text doesn't work #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've been using your excellent DOM parser for a project of mine recently, and 
came across this bug:

In the latest version (r55), consider the following to be part of the HTML 
input:

<b>0</b> zero
<b>1</b> one
<b>2</b> two

The output generated is then:

<b></b> zero
<b>1</b> one
<b>2</b> two

This is because of the following line in parse_text():
if ($this->status['text']) {
which needs to be
if ($this->status['text'] !== "") {

Because "0" obviously evaluates to false, the text contents of the <b> tag 
never gets properly saved.

Original issue reported on code.google.com by ja...@vietors.com on 30 Mar 2011 at 3:53

GoogleCodeExporter commented 8 years ago
Thank you very much for reporting!
Applied your fix in rev. #56

Original comment by niels....@gmail.com on 31 Mar 2011 at 8:38