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:
@@ -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