[Pkg-javascript-commits] [ltx] 254/469: Allow blank string and zero as XML attributes.

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:03:09 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit b1378df949a8fccda17852f044c0153df3df9cfd
Author: Manav Rathi <manav.r at directi.com>
Date:   Tue May 7 12:51:08 2013 +0530

    Allow blank string and zero as XML attributes.
---
 lib/element.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/element.js b/lib/element.js
index 7189847..603876f 100644
--- a/lib/element.js
+++ b/lib/element.js
@@ -213,7 +213,7 @@ Element.prototype.text = function(val) {
 };
 
 Element.prototype.attr = function(attr, val) {
-    if(val){
+    if (!(typeof val === 'undefined' || val === null)) {
         if(!this.attrs){
           this.attrs = {};
         }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list