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
|
|
@ -88,7 +88,7 @@ Ox.DocPage = function(options, self) {
|
|||
'<code><b>' + (name || item.name) + '</b> '
|
||||
+ '<' + item.types.join('></code> or <code><') + '> </code>'
|
||||
+ (item['default'] ? '(default: <code>' + item['default'] + '</code>) ' : '')
|
||||
+ Ox.parseHTML(item.summary)
|
||||
+ Ox.sanitizeHTML(item.summary)
|
||||
)
|
||||
];
|
||||
[
|
||||
|
|
@ -105,7 +105,7 @@ Ox.DocPage = function(options, self) {
|
|||
marginTop: (level ? 0 : 8) + 'px',
|
||||
marginLeft: (level * 32) + 'px'
|
||||
})
|
||||
.html(Ox.parseHTML(item.description))
|
||||
.html(Ox.sanitizeHTML(item.description))
|
||||
);
|
||||
} else {
|
||||
$elements.push($('<div>')
|
||||
|
|
@ -160,7 +160,7 @@ Ox.DocPage = function(options, self) {
|
|||
.css({marginLeft: (level * 32 + 16) + 'px'})
|
||||
.html(
|
||||
'<code><b>> '
|
||||
+ Ox.encodeHTML(example.statement)
|
||||
+ Ox.encodeHTMLEntities(example.statement)
|
||||
.replace(/ /g, ' ')
|
||||
.replace(/\n/g, '<br/>\n ')
|
||||
+ '</b></code>'
|
||||
|
|
@ -170,7 +170,7 @@ Ox.DocPage = function(options, self) {
|
|||
.addClass(className)
|
||||
.css({marginLeft: (level * 32 + 16) + 'px'})
|
||||
.html(
|
||||
'<code>' + Ox.encodeHTML(example.result) + '</code>'
|
||||
'<code>' + Ox.encodeHTMLEntities(example.result) + '</code>'
|
||||
)
|
||||
)
|
||||
});
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ Ox.SyntaxHighlighter = function(options, self) {
|
|||
}
|
||||
}
|
||||
source += '<span class="' + classNames + '">' +
|
||||
Ox.encodeHTML(token.value)
|
||||
Ox.encodeHTMLEntities(token.value)
|
||||
.replace(/ /g, whitespace)
|
||||
.replace(/\t/g, tab)
|
||||
.replace(/\n/g, linebreak) + '</span>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue