Split up bodyToHtml (#12840)
* Split up bodyToHtml This (very incrementally) splits up the bodyToHtml function to avoid the multiple return types and hopefully make it a touch easier to comprehend. I'd also like to see what the test coverage says about this, so this is is somewhat experimental. This shouldn't change any behaviour but the comments in this function indiciate just how subtle it is. * Remove I prefix * Missed emoji formatting part
This commit is contained in:
@@ -172,9 +172,8 @@ export default class EditHistoryMessage extends React.PureComponent<IProps, ISta
|
||||
if (this.props.previousEdit) {
|
||||
contentElements = editBodyDiffToHtml(getReplacedContent(this.props.previousEdit), content);
|
||||
} else {
|
||||
contentElements = HtmlUtils.bodyToHtml(content, null, {
|
||||
contentElements = HtmlUtils.bodyToNode(content, null, {
|
||||
stripReplyFallback: true,
|
||||
returnString: false,
|
||||
});
|
||||
}
|
||||
if (mxEvent.getContent().msgtype === MsgType.Emote) {
|
||||
|
||||
@@ -573,12 +573,11 @@ export default class TextualBody extends React.Component<IBodyProps, IState> {
|
||||
const stripReply = !mxEvent.replacingEvent() && !!getParentEventId(mxEvent);
|
||||
isEmote = content.msgtype === MsgType.Emote;
|
||||
isNotice = content.msgtype === MsgType.Notice;
|
||||
let body = HtmlUtils.bodyToHtml(content, this.props.highlights, {
|
||||
let body = HtmlUtils.bodyToNode(content, this.props.highlights, {
|
||||
disableBigEmoji: isEmote || !SettingsStore.getValue<boolean>("TextualBody.enableBigEmoji"),
|
||||
// Part of Replies fallback support
|
||||
stripReplyFallback: stripReply,
|
||||
ref: this.contentRef,
|
||||
returnString: false,
|
||||
});
|
||||
|
||||
if (this.props.replacingEventId) {
|
||||
|
||||
Reference in New Issue
Block a user