refactor: server code (#2545)
+ Remove duplicated await + Replace some legacy codes with ES6 + Fix some of eslint problems
This commit is contained in:
@@ -74,13 +74,8 @@ module.exports = {
|
||||
continue
|
||||
}
|
||||
|
||||
var closeMarkerMatched = true
|
||||
for (i = 0; i < closeMarker.length; ++i) {
|
||||
if (closeMarker[i] !== state.src[start + i]) {
|
||||
closeMarkerMatched = false
|
||||
break
|
||||
}
|
||||
}
|
||||
const i = closeMarker.findIndex(item => item !== state.src[start + i])
|
||||
const closeMarkerMatched = i !== -1
|
||||
|
||||
if (!closeMarkerMatched) {
|
||||
continue
|
||||
@@ -112,7 +107,7 @@ module.exports = {
|
||||
altToken
|
||||
)
|
||||
|
||||
var zippedCode = encode64(zlib.deflateRawSync('@startuml\n' + contents + '\n@enduml').toString('binary'))
|
||||
const zippedCode = encode64(zlib.deflateRawSync('@startuml\n' + contents + '\n@enduml').toString('binary'))
|
||||
|
||||
token = state.push('uml_diagram', 'img', 0)
|
||||
// alt is constructed from children. No point in populating it here.
|
||||
|
Reference in New Issue
Block a user