forked from 0x2620/oxjs
misc fixes
This commit is contained in:
parent
7ca9a4a9e7
commit
b77852296b
7 changed files with 28 additions and 44 deletions
|
|
@ -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 '"' 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'];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue