1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

Refactor to ES6

This commit is contained in:
asmsuechan
2017-03-21 23:27:32 -07:00
parent 10043cc755
commit 6229ca7ac9

View File

@@ -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] + ';')
} }