[Pkg-javascript-commits] [ltx] 290/469: " to '

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:03:18 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 756ecf772166bacade67e8c077bfd22a377d9e48
Author: Lloyd Watkin <lloyd.watkin at surevine.com>
Date:   Thu Jan 9 08:52:35 2014 +0000

    " to '
---
 lib/element.js | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/lib/element.js b/lib/element.js
index 4611e74..9fa7179 100644
--- a/lib/element.js
+++ b/lib/element.js
@@ -23,8 +23,8 @@ Element.prototype.is = function(name, xmlns) {
 
 /* without prefix */
 Element.prototype.getName = function() {
-    if (this.name.indexOf(":") >= 0)
-        return this.name.substr(this.name.indexOf(":") + 1)
+    if (this.name.indexOf(':') >= 0)
+        return this.name.substr(this.name.indexOf(':') + 1)
     else
         return this.name
 }
@@ -33,8 +33,8 @@ Element.prototype.getName = function() {
  * retrieves the namespace of the current element, upwards recursively
  **/
 Element.prototype.getNS = function() {
-    if (this.name.indexOf(":") >= 0) {
-        var prefix = this.name.substr(0, this.name.indexOf(":"))
+    if (this.name.indexOf(':') >= 0) {
+        var prefix = this.name.substr(0, this.name.indexOf(':'))
         return this.findNS(prefix)
     } else {
         return this.findNS()
@@ -159,7 +159,7 @@ Element.prototype.getChildrenByFilter = function(filter, recursive) {
 }
 
 Element.prototype.getText = function() {
-    var text = ""
+    var text = ''
     for(var i = 0; i < this.children.length; i++) {
 	var child = this.children[i]
         if (typeof child == 'string' || typeof child == 'number')
@@ -276,7 +276,7 @@ Element.prototype.attr = function(attr, val) {
 /*** Serialization ***/
 
 Element.prototype.toString = function() {
-    var s = ""
+    var s = ''
     this.write(function(c) {
         s += c
     })
@@ -284,24 +284,24 @@ Element.prototype.toString = function() {
 }
 
 Element.prototype.write = function(writer) {
-    writer("<")
+    writer('<')
     writer(this.name)
     for(var k in this.attrs) {
         var v = this.attrs[k]
 	if (v || v === '' || v === 0) {
-	    writer(" ")
+	    writer(' ')
             writer(k)
-            writer("=\"")
+            writer('=\'')
             if (typeof v != 'string')
 		v = v.toString(10)
             writer(escapeXml(v))
-            writer("\"")
+            writer('\'')
 	}
     }
     if (this.children.length == 0) {
-        writer("/>")
+        writer('/>')
     } else {
-        writer(">")
+        writer('>')
 	for(var i = 0; i < this.children.length; i++) {
 	    var child = this.children[i]
 	    /* Skip null/undefined */
@@ -314,9 +314,9 @@ Element.prototype.write = function(writer) {
 			writer(escapeXmlText(child.toString(10)))
 	    }
         }
-        writer("</")
+        writer('</')
         writer(this.name)
-        writer(">")
+        writer('>')
     }
 }
 
@@ -325,7 +325,7 @@ function escapeXml(s) {
         replace(/\&/g, '&').
         replace(/</g, '<').
         replace(/>/g, '>').
-        replace(/"/g, '"').
+        replace(/'/g, '"').
         replace(/'/g, ''');
 }
 

-- 
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