mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Refactor to ES6
This commit is contained in:
@@ -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] + ';')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user