Skip to content

Commit

Permalink
xmlns minify issue is fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
vkiryukhin committed Jun 14, 2012
1 parent 22d6829 commit f3b2c12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function loadTemplate(name)
case 'basic':
$('#ta').width(400);
$('#leftpanel').show();
document.getElementById('ta').value = '<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE foo SYSTEM "Foo.dtd"><a><b>bbb</b><c/><d><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></soapenv></d><e><![CDATA[ <z></z> ]]></e><f><g></g></f></a>';
document.getElementById('ta').value = '<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE foo SYSTEM "Foo.dtd"><a><b>bbb</b><c/><d><soapenv:Envelope xmlns:soapenv="http://xxx" xmlns:xsd="http://yyy" xmlns:xsi="http://zzz"></soapenv></d><e><![CDATA[ <z></z> ]]></e><f><g></g></f></a>';
$('#rightpanel').empty().load('html/basic.html');
$('#mode').html('XML');
countChars();
Expand Down
3 changes: 2 additions & 1 deletion vkbeautify.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ vkbeautify.prototype.sql = function(text,step) {
vkbeautify.prototype.xmlmin = function(text, preserveComments) {

var str = preserveComments ? text
: text.replace(/\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>/g,"");
: text.replace(/\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>/g,"")
.replace(/[ \r\n\t]{1,}xmlns/g, ' xmlns');
return str.replace(/>\s{0,}</g,"><");
}

Expand Down

0 comments on commit f3b2c12

Please sign in to comment.