Skip to content

Editing code blocks renders space/room invites #18687

Closed
matrix-org/matrix-react-sdk
#7861
@SethFalco

Description

@SethFalco

Steps to reproduce

  1. Be in a chat room.
  2. Send a message with a code block containing a space/room invite link.

Example:

Join my space:
https://matrix.to/#/#blue-panda-empyrean:matrix.org

Raw (don't copy-and-paste this, inserted nbsp characters for formatting):

``​`md
Join my space:
https://matrix.to/#/#blue-panda-empyrean:matrix.org
``​`
  1. Edit the message, for example:
- Join my space:
+ Join my space!

What happened?

The invite gets rendered inside of the code block.

Before Edit:
image

After Edit:
image

What did you expect?

Code blocks should have text inside displayed literally. So, it should display the literal text without rendering the badge/image of the space/room.

Operating system

Ubuntu 20.04

Browser information

Firefox 91.0.1 (64-bit)

URL for webapp

develop.element.io

Have you submitted a rageshake?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ComposerA-Message-EditingA-TimelineO-UncommonMost users are unlikely to come across this or unexpected workflowS-MinorImpairs non-critical functionality or suitable workarounds existT-Defect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions