Skip to content

Issue with Syntax module - when trying to replace a highlighted text, the text gets deleted #3522

@darbentov

Description

@darbentov

Hi, I'm using the Syntax module in order to do syntax highlighting of code blocks.
I stumbled upon an issue where I'm trying to replace a highlighted text with a different text, the text gets deleted.

Link to demo:
https://codesandbox.io/s/quill-with-syntax-highlighting-bug-when-trying-to-replace-an-highlighted-text-x5uw9?file=/src/syntax.js

Steps to reproduce:

  1. Write console.log("hi"); inside the quill editor
  2. Click on the "code" formatting
  3. Select the highlighted text
  4. Press any letter instead
  5. The text will get deleted.

image

image

This is the result after typing "a":
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions