forked from 0x2620/oxjs
some improvements to Ox.Editable
This commit is contained in:
parent
188656bd99
commit
1eb93125e6
2 changed files with 34 additions and 33 deletions
|
|
@ -37,10 +37,9 @@ Ox.parseHTML <f> Takes HTML from an untrusted source and returns something sane
|
|||
|
||||
Ox.parseHTML = (function() {
|
||||
var defaultTags = [
|
||||
// fixme: why not p?
|
||||
'a', 'b', 'blockquote', 'cite', 'code',
|
||||
'a', 'b', 'blockquote', 'br', 'cite', 'code',
|
||||
'del', 'em', 'i', 'img', 'ins',
|
||||
'li', 'ol', 'q', 'rtl', 's',
|
||||
'li', 'ol', 'p', 'q', 'rtl', 's',
|
||||
'strong', 'sub', 'sup', 'ul', '[]'
|
||||
],
|
||||
parse = {
|
||||
|
|
@ -89,7 +88,8 @@ Ox.parseHTML = (function() {
|
|||
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/g, '<br/>\n');
|
||||
html = html.replace(/\n/g, '<br/>');
|
||||
// close extra opening (and remove extra closing) tags
|
||||
// note: this converts '"' to '"'
|
||||
return Ox.element('<div>').html(html).html();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue