1
0
Fork 0
forked from 0x2620/oxjs

misc fixes

This commit is contained in:
rolux 2012-01-02 19:35:14 +05:30
commit b77852296b
7 changed files with 28 additions and 44 deletions

View file

@ -71,7 +71,6 @@ Ox.parseHTML = (function() {
}
},
tab = '\t';
return function(html, tags, wikilinks) {
var matches = [],
tags = tags || defaultTags;
@ -94,17 +93,14 @@ Ox.parseHTML = (function() {
html = Ox.encodeHTML(html);
html = Ox.parseURLs(html);
html = Ox.parseEmailAddresses(html);
//Ox.print('Ox.parseHTML', html, 'matches', matches);
matches.forEach(function(match, i) {
html = html.replace(new RegExp(tab + i + tab, 'gi'), match);
});
//html = html.replace(/\n/g, '<br/>\n');
html = html.replace(/\n\n/g, '<br/><br/>');
// close extra opening (and remove extra closing) tags
// note: this converts '&quot;' to '"'
return Ox.element('<div>').html(html).html();
}
}());
/*@
@ -132,7 +128,6 @@ Ox.parseURL <f> Takes a URL, returns its components
'?a=0&b=1'
@*/
Ox.parseURL = (function() {
// fixme: leak memory, like now, or create every time? ... benchmark??
var a = document.createElement('a'),
keys = ['hash', 'host', 'hostname', 'origin',
'pathname', 'port', 'protocol', 'search'];