Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix after upgrading the wysiswyg package
Browse files Browse the repository at this point in the history
  • Loading branch information
Germain committed Jul 27, 2023
1 parent b957783 commit a662296
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export class MessageComposer extends React.Component<IProps, IState> {

const { isRichTextEnabled, composerContent } = this.state;
const convertedContent = isRichTextEnabled
? await richToPlain(composerContent)
? await richToPlain(composerContent, false)
: await plainToRich(composerContent, false);

this.setState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ export const dynamicImportConversionFunctions = async (): Promise<{
* ensure that HTML entities are correctly interpreted, and to prevent newline characters being turned into `<br>`.
*
* @param rich - html to convert
* @param inMessageFormat - `true` to format the return value for use as a message `formatted_body`.
* `false` to format it for writing to an editor element.
* @returns a string of plain text that may contain markdown
*/
richToPlain(rich: string): Promise<string>;
richToPlain(rich: string, inMessageFormat: boolean): Promise<string>;

/**
* Creates a rust model from plain text input (interpreted as markdown) and uses it to generate the rich text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function createMessageContent(

// if we're editing rich text, the message content is pure html
// BUT if we're not, the message content will be plain text where we need to convert the mentions
const body = isHTML ? await richToPlain(message) : convertPlainTextToBody(message);
const body = isHTML ? await richToPlain(message, false) : convertPlainTextToBody(message);
const bodyPrefix = (isReplyAndEditing && getTextReplyFallback(editedEvent)) || "";
const formattedBodyPrefix = (isReplyAndEditing && getHtmlReplyFallback(editedEvent)) || "";

Expand Down

0 comments on commit a662296

Please sign in to comment.