Permalink
Browse files

Merge branch 'master' of https://github.com/tautologistics/node-htmlp…

  • Loading branch information...
2 parents d2c6059 + 83722ba commit 2b012f19c4804fe507b82fbf157751fb1edf593c Felix Gnass committed Nov 12, 2010
Showing with 10 additions and 9 deletions.
  1. +8 −7 lib/node-htmlparser.js
  2. +2 −2 lib/node-htmlparser.min.js
View
@@ -18,7 +18,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
***********************************************/
-/* v1.6.3 */
+/* v1.6.4 */
(function () {
@@ -250,17 +250,18 @@ function Parser (handler) {
element.type = ElementType.Text;
//If the previous element is text, append the current text to it
if (this._elements.length && this._elements[this._elements.length - 1].type == ElementType.Text) {
+ var prevElement = this._elements[this._elements.length - 1];
if (element.raw != "") {
- var prevElement = this._elements[this._elements.length - 1];
prevElement.raw = prevElement.data = prevElement.raw + this._prevTagSep + element.raw;
element.raw = element.data = ""; //This causes the current element to not be added to the element list
- }
- else //Element is empty, so just append the last tag marker found
+ } else { //Element is empty, so just append the last tag marker found
prevElement.raw = prevElement.data = prevElement.raw + this._prevTagSep;
- }
- else //The previous element was not text
- if (element.raw != "")
+ }
+ } else { //The previous element was not text
+ if (element.raw != "") {
element.raw = element.data = element.raw;
+ }
+ }
}
}
}
Oops, something went wrong.

0 comments on commit 2b012f1

Please sign in to comment.