Skip to content

Commit

Permalink
[parser] don't overwrite attribute values on second occurence
Browse files Browse the repository at this point in the history
as described in tautologistics#42
  • Loading branch information
fb55 committed Jul 21, 2013
1 parent 830c157 commit a6b6865
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Parser.js
Expand Up @@ -174,7 +174,12 @@ Parser.prototype.onattribname = function(name){

Parser.prototype.onattribvalue = function attribValue(value){
if(this._cbs.onattribute) this._cbs.onattribute(this._attribname, value);
if(this._attribs) this._attribs[this._attribname] = value;
if(
this._attribs &&
!Object.prototype.hasOwnProperty.call(this._attribs, this._attribname)
){
this._attribs[this._attribname] = value;
}
this._attribname = "";
};

Expand Down

0 comments on commit a6b6865

Please sign in to comment.