Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -25,7 +25,12 @@ import SettingsStore from "../../../../../settings/SettingsStore";
|
|||
import EditorStateTransfer from "../../../../../utils/EditorStateTransfer";
|
||||
|
||||
function getFormattedContent(editorStateTransfer: EditorStateTransfer): string {
|
||||
return editorStateTransfer.getEvent().getContent().formatted_body?.replace(/<mx-reply>.*<\/mx-reply>/, '') || '';
|
||||
return (
|
||||
editorStateTransfer
|
||||
.getEvent()
|
||||
.getContent()
|
||||
.formatted_body?.replace(/<mx-reply>.*<\/mx-reply>/, "") || ""
|
||||
);
|
||||
}
|
||||
|
||||
function parseEditorStateTransfer(
|
||||
|
@ -39,13 +44,13 @@ function parseEditorStateTransfer(
|
|||
if (editorStateTransfer.hasEditorState()) {
|
||||
// if restoring state from a previous editor,
|
||||
// restore serialized parts from the state
|
||||
parts = editorStateTransfer.getSerializedParts().map(p => partCreator.deserializePart(p));
|
||||
parts = editorStateTransfer.getSerializedParts().map((p) => partCreator.deserializePart(p));
|
||||
} else {
|
||||
// otherwise, either restore serialized parts from localStorage or parse the body of the event
|
||||
// TODO local storage
|
||||
// const restoredParts = this.restoreStoredEditorState(partCreator);
|
||||
|
||||
if (editorStateTransfer.getEvent().getContent().format === 'org.matrix.custom.html') {
|
||||
if (editorStateTransfer.getEvent().getContent().format === "org.matrix.custom.html") {
|
||||
return getFormattedContent(editorStateTransfer);
|
||||
}
|
||||
|
||||
|
@ -54,7 +59,7 @@ function parseEditorStateTransfer(
|
|||
});
|
||||
}
|
||||
|
||||
return parts.reduce((content, part) => content + part.text, '');
|
||||
return parts.reduce((content, part) => content + part.text, "");
|
||||
// Todo local storage
|
||||
// this.saveStoredEditorState();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue