1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +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) {
var entities = [
const entities = [
['\'', 'apos'],
['&', 'amp'],
['<', 'lt'],
@@ -34,7 +34,7 @@ function encodeHTMLEntities (text) {
['?', '#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] + ';')
}