forked from 0x2620/oxjs
Ox.parseHTML -> Ox.sanitizeHTML, Ox.encodeHTML -> Ox.encodeHTMLEntities, Ox.decodeHTML -> Ox.decodeHTMLEntities
This commit is contained in:
parent
fef07dff6f
commit
c41afd2f5d
9 changed files with 28 additions and 26 deletions
|
|
@ -155,7 +155,7 @@ Ox.Editable = function(options, self) {
|
|||
}
|
||||
|
||||
function formatInputValue() {
|
||||
return Ox.decodeHTML(
|
||||
return Ox.decodeHTMLEntities(
|
||||
self.options.type == 'input'
|
||||
? self.options.value
|
||||
: self.options.value.replace(/<br\/?><br\/?>/g, '\n\n')
|
||||
|
|
@ -163,7 +163,7 @@ Ox.Editable = function(options, self) {
|
|||
}
|
||||
|
||||
function formatTestValue() {
|
||||
var value = Ox.encodeHTML(self.$input.options('value'));
|
||||
var value = Ox.encodeHTMLEntities(self.$input.options('value'));
|
||||
return !value ? ' '
|
||||
: self.options.type == 'input'
|
||||
? value.replace(/ /g, ' ')
|
||||
|
|
@ -181,7 +181,7 @@ Ox.Editable = function(options, self) {
|
|||
value = self.options.format(self.options.value)
|
||||
}
|
||||
if (self.options.highlight) {
|
||||
value = Ox.highlightHTML(value, self.options.highlight, 'OxHighlight');
|
||||
value = Ox.highlightHTML(value, self.options.highlight, 'OxHighlight', true);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
@ -191,8 +191,8 @@ Ox.Editable = function(options, self) {
|
|||
self.$input.value().replace(/\n\n+/g, '\0')
|
||||
).replace(/\0/g, '\n\n').trim();
|
||||
return (self.options.type == 'input'
|
||||
? Ox.encodeHTML(value)
|
||||
: Ox.parseHTML(value)
|
||||
? Ox.encodeHTMLEntities(value)
|
||||
: Ox.sanitizeHTML(value)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue