lib/parser/abbreviation.js
function(name, value) {
			if (arguments.length == 2) {
				if (value === null) {
					// remove attribute
					var vals = this._attributes.filter(function(attr) {
						return attr.name === name;
					});

					var that = this;
					vals.forEach(function(attr) {
						var ix = that._attributes.indexOf(attr);
						if (~ix) {
							that._attributes.splice(ix, 1);
						}
					});

					return;
				}

				// modify attribute
				var attrNames = this._attributes.map(function(attr) {
					return attr.name;
				});
				var ix = attrNames.indexOf(name.toLowerCase());
				if (~ix) {
					this._attributes[ix].value = value;
				} else {
					this._attributes.push({
						name: name,
						value: value
					});
				}
			}
			
			return (utils.find(this.attributeList(), function(attr) {
				return attr.name == name;
			}) || {}).value;
		}
function(name, value) {
			if (arguments.length == 2) {
				if (value === null) {
					// remove attribute
					var vals = this._attributes.filter(function(attr) {
						return attr.name === name;
					});

					var that = this;
					vals.forEach(function(attr) {
						var ix = that._attributes.indexOf(attr);
						if (~ix) {
							that._attributes.splice(ix, 1);
						}
					});

					return;
				}

				// modify attribute
				var attrNames = this._attributes.map(function(attr) {
					return attr.name;
				});
				var ix = attrNames.indexOf(name.toLowerCase());
				if (~ix) {
					this._attributes[ix].value = value;
				} else {
					this._attributes.push({
						name: name,
						value: value
					});
				}
			}
			
			return (utils.find(this.attributeList(), function(attr) {
				return attr.name == name;
			}) || {}).value;
		}
function ( name , value ) { if ( arguments . length == 2 ) { if ( value === null ) { // remove attribute var vals = this . _attributes . filter ( function ( attr ) { return attr . name === name ; } ) ; var that = this ; vals . forEach ( function ( attr ) { var ix = that . _attributes . indexOf ( attr ) ; if ( ~ ix ) { that . _attributes . splice ( ix , 1 ) ; } } ) ; return ; } // modify attribute var attrNames = this . _attributes . map ( function ( attr ) { return attr . name ; } ) ; var ix = attrNames . indexOf ( name . toLowerCase ( ) ) ; if ( ~ ix ) { this . _attributes [ ix ] . value = value ; } else { this . _attributes . push ( { name : name , value : value } ) ; } } return ( utils . find ( this . attributeList ( ) , function ( attr ) { return attr . name == name ; } ) || { } ) . value ; }
Returns or sets attribute value
@param {String} name Attribute name
@param {String} value New attribute value. `Null` value
will remove attribute
@returns {String}
Returns or sets attribute value