Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax module not highlighting correctly #4211

Open
Sinsho opened this issue May 15, 2024 · 0 comments
Open

Syntax module not highlighting correctly #4211

Sinsho opened this issue May 15, 2024 · 0 comments

Comments

@Sinsho
Copy link

Sinsho commented May 15, 2024

The syntax module for highlighting in quill does not work as expected. It wrongly highlights code (in this example json code).

Steps for Reproduction

  1. Visit: https://quilljs.com/playground/snow#codeN4Ig9AlgdgJgpgDwHQCsDOIBcIDGB7KNAFwAIBHAVwgBtqSBeEqOAdxIEUraAKAcgGI4MCETwAnXgBoSwADpQSJALZ4YFanDSYZ8xYrQBPKEQCGCbXIV7FAC2rptLaDDwskd9JN3WS1E1ABzChMAzW0AbW8fGRIAazgDbVkQdAJk6T8AIzhqJJS0NJASAF8ovQBdLytFYqrrUTxqTJMxCLLFcN58eABaTOo8HFjeSrLRq1rvIhs4JThtXjQoVykSMDAScRJeTIpM-rheeWKASgBueUoaaiQAM3ElEyI+brg+gaHV3lSoL4o0OASc6XLg3aAAsREAAqiGeAAZpLw5N5kv40CxAWhkm0QABZPAUYwkACiADdAZoiOkSMkACIUe4UMRoAAOIgAXnBqckAAo0J7-ZLlWTHXjnECScDORDuIhKahYEAAHmEpJIEBg9GSQhE4mSAD4lWBVfr5PIlWgcGIICzSGgxDgtVLYDL0AajZbrbb9SBikA

Expected behavior:
Correct highlighting like this:
expected_behaviour

Actual behavior:
The punctuation ":" gets annotated as the attribute, the string "Mount Everest" gets annotated as punctuation and all the following "," (except the first one) as well as the closing "]" get annotated as string.
actual_behaviour

Version:
2.0.2

I have tried to find out where the bug comes from in the syntax module and have found out following:
The Delta object as well as the container returned in highlightBlot on this line contain the correct annotation. These are the children returned as the container:
container

I have failed to find out where it exactly goes wrong (the time between returning the correct delta and actual modifying the delta to some incorrect state) and would be extremely happy if somebody could take a look at this :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant