From b1261ad942946102da28a5df1247208d2bfb57e7 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 17 Jan 2018 14:56:25 -0800 Subject: [PATCH] Fix Mermaid drawings not loading on some browsers As mentioned in https://github.com/knsv/mermaid/issues/291#issuecomment-287673609, the parameter should be `startOnLoad` instead of `loadOnStart`. In addition, `mermaid.initialize()` expects to see `startOnLoad` in the `mermaid` hash: https://github.com/knsv/mermaid/blob/6cd5ffe637d88525b93417bf3954e9c0e5a4deb8/src/mermaid.js#L118 Closes #42052 --- app/assets/javascripts/render_mermaid.js | 6 +++++- changelogs/unreleased/sh-fix-mermaid-start-on-load-typo.yml | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/sh-fix-mermaid-start-on-load-typo.yml diff --git a/app/assets/javascripts/render_mermaid.js b/app/assets/javascripts/render_mermaid.js index b7cde6fb092..31c7a772cf4 100644 --- a/app/assets/javascripts/render_mermaid.js +++ b/app/assets/javascripts/render_mermaid.js @@ -19,7 +19,11 @@ export default function renderMermaid($els) { import(/* webpackChunkName: 'mermaid' */ 'blackst0ne-mermaid').then((mermaid) => { mermaid.initialize({ - loadOnStart: false, + // mermaid core options + mermaid: { + startOnLoad: false, + }, + // mermaidAPI options theme: 'neutral', }); diff --git a/changelogs/unreleased/sh-fix-mermaid-start-on-load-typo.yml b/changelogs/unreleased/sh-fix-mermaid-start-on-load-typo.yml new file mode 100644 index 00000000000..a2d4ade8e54 --- /dev/null +++ b/changelogs/unreleased/sh-fix-mermaid-start-on-load-typo.yml @@ -0,0 +1,5 @@ +--- +title: Fix Mermaid drawings not loading on some browsers +merge_request: +author: +type: fixed