mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
Refactor to ES6
This commit is contained in:
@@ -26,7 +26,7 @@ function decodeHTMLEntities (text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function encodeHTMLEntities (text) {
|
function encodeHTMLEntities (text) {
|
||||||
var entities = [
|
const entities = [
|
||||||
['\'', 'apos'],
|
['\'', 'apos'],
|
||||||
['&', 'amp'],
|
['&', 'amp'],
|
||||||
['<', 'lt'],
|
['<', 'lt'],
|
||||||
@@ -34,7 +34,7 @@ function encodeHTMLEntities (text) {
|
|||||||
['?', '#63']
|
['?', '#63']
|
||||||
]
|
]
|
||||||
|
|
||||||
for (var i = 0, max = entities.length; i < max; ++i) {
|
for (let i = 0; i < entities.length; ++i) {
|
||||||
text = text.replace(entities[i][0], '&' + entities[i][1] + ';')
|
text = text.replace(entities[i][0], '&' + entities[i][1] + ';')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user