From d289916a41c0fc2a66705de008da8888be7df6c3 Mon Sep 17 00:00:00 2001 From: Ze Yu Date: Thu, 2 Apr 2020 01:30:35 +0800 Subject: [PATCH] Normalize inline puml line ending before hashing --- src/util/pluginUtil.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/pluginUtil.js b/src/util/pluginUtil.js index 15003674d0..9d24a89170 100644 --- a/src/util/pluginUtil.js +++ b/src/util/pluginUtil.js @@ -24,7 +24,9 @@ const pluginUtil = { return `${filePath}.png`; } - const hashedContent = cryptoJS.MD5(content).toString(); + // This is to keep the hash consistent across windows / unix systems + const normalizedContent = content.replace(/\r\n/g, '\n'); + const hashedContent = cryptoJS.MD5(normalizedContent).toString(); return `${hashedContent}.png`; },