diff --git a/server/modules/rendering/markdown-kroki/renderer.js b/server/modules/rendering/markdown-kroki/renderer.js index 1487f737..801bab6d 100644 --- a/server/modules/rendering/markdown-kroki/renderer.js +++ b/server/modules/rendering/markdown-kroki/renderer.js @@ -73,8 +73,13 @@ module.exports = { continue } - const i = closeMarker.findIndex(item => item !== state.src[start + i]) - const closeMarkerMatched = i !== -1 + let closeMarkerMatched = true + for (i = 0; i < closeMarker.length; ++i) { + if (closeMarker[i] !== state.src[start + i]) { + closeMarkerMatched = false + break + } + } if (!closeMarkerMatched) { continue diff --git a/server/modules/rendering/markdown-plantuml/renderer.js b/server/modules/rendering/markdown-plantuml/renderer.js index 0ad67e9e..40eedc04 100644 --- a/server/modules/rendering/markdown-plantuml/renderer.js +++ b/server/modules/rendering/markdown-plantuml/renderer.js @@ -74,8 +74,13 @@ module.exports = { continue } - const i = closeMarker.findIndex(item => item !== state.src[start + i]) - const closeMarkerMatched = i !== -1 + let closeMarkerMatched = true + for (i = 0; i < closeMarker.length; ++i) { + if (closeMarker[i] !== state.src[start + i]) { + closeMarkerMatched = false + break + } + } if (!closeMarkerMatched) { continue