diff options
author | Stan Hu <stanhu@gmail.com> | 2018-01-17 14:56:25 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-01-17 20:12:48 -0800 |
commit | b1261ad942946102da28a5df1247208d2bfb57e7 (patch) | |
tree | f13c8bdc0975072528c0f12fb5bff796ff761e35 | |
parent | 3228ac06a019c9126b965ff32e354d10011a4f76 (diff) | |
download | gitlab-ce-b1261ad942946102da28a5df1247208d2bfb57e7.tar.gz |
Fix Mermaid drawings not loading on some browserssh-fix-mermaid-start-on-load-typo
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
-rw-r--r-- | app/assets/javascripts/render_mermaid.js | 6 | ||||
-rw-r--r-- | changelogs/unreleased/sh-fix-mermaid-start-on-load-typo.yml | 5 |
2 files changed, 10 insertions, 1 deletions
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 |