You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Send HTML if there are any entities present in the composer
This is so that pasted HTML links that are represented as entities are sent as HTML.
This commit is contained in:
@@ -591,6 +591,14 @@ export default class MessageComposerInput extends React.Component {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!shouldSendHTML) {
|
||||
const hasAnEntity = blocks.some((block) => {
|
||||
return block.getCharacterList().filter((c) => {
|
||||
return c.getEntity();
|
||||
}).size > 0;
|
||||
});
|
||||
shouldSendHTML = hasAnEntity;
|
||||
}
|
||||
if (shouldSendHTML) {
|
||||
contentHTML = HtmlUtils.processHtmlForSending(
|
||||
RichText.contentStateToHTML(contentState),
|
||||
|
||||
Reference in New Issue
Block a user