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:
Luke Barnard 2017-07-13 13:27:49 +01:00
parent 55e1202c09
commit 4b96963408

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