mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
Only add the code copy button for HTML messages
Trivial fast-path optimisation: plain text messages cannot possibly contain pre blocks so there's no point in trying to parse them in order to add code copy buttons.
This commit is contained in:
parent
1f84c68180
commit
fe79010e4e
1 changed files with 1 additions and 1 deletions
|
@ -393,7 +393,7 @@ export function bodyToHtml(content, highlights, opts) {
|
|||
}
|
||||
safeBody = sanitizeHtml(body, sanitizeHtmlParams);
|
||||
safeBody = unicodeToImage(safeBody);
|
||||
safeBody = addCodeCopyButton(safeBody);
|
||||
if (isHtml) safeBody = addCodeCopyButton(safeBody);
|
||||
}
|
||||
finally {
|
||||
delete sanitizeHtmlParams.textFilter;
|
||||
|
|
Loading…
Reference in a new issue