From b30790cac4d478b2969f1cd138efa04a0f9b8e0a Mon Sep 17 00:00:00 2001 From: ashishj Date: Thu, 28 Apr 2022 20:09:42 +0200 Subject: [PATCH] Added default new line in the diagram text before parsing for special case where code is trimmed --- src/mermaidAPI.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mermaidAPI.js b/src/mermaidAPI.js index 176b2b2f6d..030b2e6ac9 100644 --- a/src/mermaidAPI.js +++ b/src/mermaidAPI.js @@ -69,6 +69,7 @@ import DOMPurify from 'dompurify'; * @returns {any} */ function parse(text) { + text = text + '\n'; const cnf = configApi.getConfig(); const graphInit = utils.detectInit(text, cnf); if (graphInit) {