Skip to content

Commit

Permalink
search separately for "xmlns:" and "xmlns="
Browse files Browse the repository at this point in the history
  • Loading branch information
vkiryukhin committed Jun 13, 2012
1 parent 0cdb899 commit 753802c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vkbeautify.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ vkbeautify.prototype.xml = function(text,step) {

var ar = text.replace(/>\s{0,}</g,"><")
.replace(/</g,"~::~<")
.replace(/xmlns/g,"~::~xmlns:")
.replace(/xmlns/g,"~::~xmlns\:")
.replace(/xmlns/g,"~::~xmlns\=")
.split('~::~'),
len = ar.length,
inComment = false,
Expand Down Expand Up @@ -136,8 +137,8 @@ vkbeautify.prototype.xml = function(text,step) {
if(ar[ix].search(/<\?/) > -1) {
str += shift[deep]+ar[ix];
} else
// xmlns: //
if(ar[ix].search(/xmlns/) > -1) {
// xmlns //
if( ar[ix].search(/xmlns\:/) > -1 || ar[ix].search(/xmlns\=/) > -1) {
str += shift[deep]+ar[ix];
}

Expand Down

0 comments on commit 753802c

Please sign in to comment.