diff --git a/index.html b/index.html index d3a9896..ecf9baa 100644 --- a/index.html +++ b/index.html @@ -1,8 +1,11 @@ - + + + + @@ -12,7 +15,11 @@ vkBeautify - javascript plugin @@ -28,6 +35,7 @@

vkBeautify

 | 
  • GitHub
  •  |  +
    diff --git a/main.js b/main.js index b0f92cd..fc4abaa 100644 --- a/main.js +++ b/main.js @@ -90,10 +90,7 @@ function loadTemplate(name) case 'basic': $('#ta').width(400); $('#leftpanel').show(); - document.getElementById('ta').value = '' - + 'bbb' - + ' ]]>' - + ' '; + document.getElementById('ta').value = 'bbb ]]>'; $('#rightpanel').empty().load('html/basic.html'); $('#mode').html('XML'); countChars(); diff --git a/vkbeautify.js b/vkbeautify.js index ab69bb0..250c2b9 100644 --- a/vkbeautify.js +++ b/vkbeautify.js @@ -84,7 +84,10 @@ function vkbeautify(){ vkbeautify.prototype.xml = function(text,step) { - var ar = text.replace(/>\s{0,}<").replace(/\s{0,}<") + .replace(/ // if(ar[ix].search(/<\?/) > -1) { str += shift[deep]+ar[ix]; - } else { + } else + // xmlns: // + if(ar[ix].search(/xmlns/) > -1) { + str += shift[deep]+ar[ix]; + } + + else { str += ar[ix]; } }