Skip to content

[BUG] Markdown links are removed when toggling to rich text mode #1370

@widal001

Description

@widal001

Fider Cloud or Self Hosted
Fider Cloud

Describe the bug
When links are added to a post or comment in markdown mode, e.g. [link](https://example.com), and posted directly they appear correctly in the post or comment. But if a user toggles to rich text mode or clicks "edit" on their post (which opens up the editor in rich text mode), the link will be stripped out.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a post on the demo board
  2. Click into the editor to leave a comment, then click the button to "switch to markdown editor"
  3. Paste the following into the input box: [link](https://example.com)
  4. Click the button to "switch to rich text editor"
  5. See that just the plain text description of the link is preserved
  6. Switch back to the markdown editor
  7. See that the markdown link syntax has been removed

Expected behavior
A clear and concise description of what you expected to happen.

When switching to rich text editor, the link should be displayed as a hyperlink (similar to when it's posted) then when switching back, the original markdown link syntax should be preserved.

Screenshots
If applicable, add screenshots to help explain your problem.

Adding a link in markdown mode:

Image

Link appears successfully if you post directly from markdown mode:

Image

If we click edit, the link disappears in rich text mode, even when we switch back to markdown mode:

Image Image

Additional context
Add any other context about the problem here.

I have a fix for this that I can put up in a PR after creating this bug ticket. Separately an enhancement might be to add a menu button to insert a link, but I can try to tackle that in a separate PR since it requires changing a few more components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugsomething is broken, we need to fix it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions