You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Use plaintext when loading a markdown history item into RT mode
This commit is contained in:
@ -38,13 +38,11 @@ class HistoryItem {
|
|||||||
const contentState = convertFromRaw(this.rawContentState);
|
const contentState = convertFromRaw(this.rawContentState);
|
||||||
if (outputFormat === 'markdown') {
|
if (outputFormat === 'markdown') {
|
||||||
if (this.format === 'html') {
|
if (this.format === 'html') {
|
||||||
console.info(outputFormat, 'to other format');
|
|
||||||
return ContentState.createFromText(RichText.stateToMarkdown(contentState));
|
return ContentState.createFromText(RichText.stateToMarkdown(contentState));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.format === 'markdown') {
|
if (this.format === 'markdown') {
|
||||||
console.info(outputFormat, 'to other format');
|
return RichText.htmlToContentState(new Markdown(contentState.getPlainText()).toHTML());
|
||||||
return RichText.htmlToContentState(new Markdown(contentState).toHTML());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// history item has format === outputFormat
|
// history item has format === outputFormat
|
||||||
|
Reference in New Issue
Block a user