diff options
Diffstat (limited to 'webapp/utils/markdown.jsx')
-rw-r--r-- | webapp/utils/markdown.jsx | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/webapp/utils/markdown.jsx b/webapp/utils/markdown.jsx index 65c4c0396..8733e6200 100644 --- a/webapp/utils/markdown.jsx +++ b/webapp/utils/markdown.jsx @@ -4,29 +4,9 @@ import * as TextFormatting from './text_formatting.jsx'; import * as SyntaxHighlighting from './syntax_highlighting.jsx'; -import {postListScrollChange} from 'actions/global_actions.jsx'; - import marked from 'marked'; import katex from 'katex'; -function markdownImageLoaded(image) { - if (image.hasAttribute('height') && image.attributes.height.value !== 'auto') { - const maxHeight = parseInt(global.getComputedStyle(image).maxHeight, 10); - - if (image.attributes.height.value > maxHeight) { - image.style.height = maxHeight + 'px'; - image.style.width = ((maxHeight * image.attributes.width.value) / image.attributes.height.value) + 'px'; - } else { - image.style.height = image.attributes.height.value + 'px'; - } - } else { - image.style.height = 'auto'; - } - - postListScrollChange(); -} -global.markdownImageLoaded = markdownImageLoaded; - class MattermostMarkdownRenderer extends marked.Renderer { constructor(options, formattingOptions = {}) { super(options); @@ -155,7 +135,7 @@ class MattermostMarkdownRenderer extends marked.Renderer { if (dimensions.length > 1) { out += ' height="' + dimensions[1] + '"'; } - out += ' onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img"'; + out += ' class="markdown-inline-img"'; out += this.options.xhtml ? '/>' : '>'; return out; } |