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.
pull/21833/head
Luke Barnard 2017-07-13 13:27:49 +01:00
parent 55e1202c09
commit 4b96963408
1 changed files with 8 additions and 0 deletions

View File

@ -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),