mirror of https://github.com/vector-im/riot-web
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.pull/21833/head
parent
1f84c68180
commit
fe79010e4e
|
@ -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 New Issue