mirror of
https://github.com/vector-im/element-web.git
synced 2026-07-04 22:38:45 +00: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:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user