mirror of https://github.com/vector-im/riot-web
Fix a couple of more errors due to API changes
parent
901cbf495d
commit
a27eefd893
|
@ -51,7 +51,8 @@ export const contentStateToHTML = (contentState: ContentState) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export function htmlToContentState(html: string): ContentState {
|
export function htmlToContentState(html: string): ContentState {
|
||||||
return ContentState.createFromBlockArray(convertFromHTML(html));
|
const blockArray = convertFromHTML(html).contentBlocks;
|
||||||
|
return ContentState.createFromBlockArray(blockArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
function unicodeToEmojiUri(str) {
|
function unicodeToEmojiUri(str) {
|
||||||
|
|
|
@ -735,7 +735,7 @@ export default class MessageComposerInput extends React.Component {
|
||||||
const pt = contentState.getBlocksAsArray().map((block) => {
|
const pt = contentState.getBlocksAsArray().map((block) => {
|
||||||
let blockText = block.getText();
|
let blockText = block.getText();
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
this.findLinkEntities(block, (start, end) => {
|
this.findLinkEntities(contentState, block, (start, end) => {
|
||||||
const entity = contentState.getEntity(block.getEntityAt(start));
|
const entity = contentState.getEntity(block.getEntityAt(start));
|
||||||
if (entity.getType() !== 'LINK') {
|
if (entity.getType() !== 'LINK') {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue