diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-12 15:14:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-12 15:14:10 +0300 |
commit | da646aac6c559584f63d1fc06132d7351abcfac6 (patch) | |
tree | e6e17878b47c081dcd7e161e9bfc3bacd535c8a6 /app/assets/javascripts/behaviors | |
parent | 612dd7d31ab927dd79968a6be7cb36599291bace (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js index 92cdd1c600f..b9e4c7b68b0 100644 --- a/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js @@ -31,6 +31,7 @@ const MAX_CHAR_LIMIT = 2000; const MAX_MERMAID_BLOCK_LIMIT = 50; // Max # of `&` allowed in Chaining of links syntax const MAX_CHAINING_OF_LINKS_LIMIT = 30; +const BUFFER_IFRAME_HEIGHT = 10; // Keep a map of mermaid blocks we've already rendered. const elsProcessingMap = new WeakMap(); let renderedMermaidBlocks = 0; @@ -117,9 +118,9 @@ function renderMermaidEl(el, source) { if (event.origin !== 'null' || event.source !== iframeEl.contentWindow) { return; } - const { h, w } = event.data; - iframeEl.width = w; - iframeEl.height = h; + const { h } = event.data; + iframeEl.width = '100%'; + iframeEl.height = `${h + BUFFER_IFRAME_HEIGHT}px`; }, false, ); |