From 702a8ff4a947adba2f859f9e063655d8d3652b44 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Sun, 8 Dec 2019 01:01:19 +0000
Subject: [PATCH 1/6] Change ref handling in TextualBody to prevent it parsing
generated nodes Remove unused paths
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/HtmlUtils.js | 5 ++--
.../views/context_menus/MessageContextMenu.js | 2 +-
src/components/views/messages/TextualBody.js | 29 ++++++++++---------
3 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js
index 2b7384a5aa..9cf3994ff4 100644
--- a/src/HtmlUtils.js
+++ b/src/HtmlUtils.js
@@ -394,6 +394,7 @@ class TextHighlighter extends BaseHighlighter {
* opts.stripReplyFallback: optional argument specifying the event is a reply and so fallback needs removing
* opts.returnString: return an HTML string rather than JSX elements
* opts.forComposerQuote: optional param to lessen the url rewriting done by sanitization, for quoting into composer
+ * opts.ref: React ref to attach to any React components returned (not compatible with opts.returnString)
*/
export function bodyToHtml(content, highlights, opts={}) {
const isHtmlMessage = content.format === "org.matrix.custom.html" && content.formatted_body;
@@ -476,8 +477,8 @@ export function bodyToHtml(content, highlights, opts={}) {
});
return isDisplayedWithHtml ?
- :
- { strippedBody };
+ :
+ { strippedBody };
}
/**
diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js
index efbfc4322f..2084a67cdc 100644
--- a/src/components/views/context_menus/MessageContextMenu.js
+++ b/src/components/views/context_menus/MessageContextMenu.js
@@ -422,7 +422,7 @@ module.exports = createReactClass({
);
- if (this.props.eventTileOps && this.props.eventTileOps.getInnerText) {
+ if (this.props.eventTileOps) { // this event is rendered using TextuaLBody
quoteButton = (
);
- if (this.props.eventTileOps) { // this event is rendered using TextuaLBody
+ if (this.props.eventTileOps) { // this event is rendered using TextualBody
quoteButton = (