You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After implementing syntax highlighting in a code-block, I noticed that as you type code into the code block, on occasion the Quill text-change event incorrectly emits a "token" attribute as part of it's delta. This doesn't occur with every edit in the code block, but occurs rather frequently.
The issue is the "token" attribute shouldn't be emitted at all as part of the text-change event since syntax highlighting shouldn't have any effect on the generated delta.
Here is a video going through the below repro steps and reproducing the issue: https://cl.ly/2x440N2z230V
Any idea what's going on? Or workarounds? Thanks!
Steps for Reproduction
Visit quilljs.com
Open the console and paste in the following:
quill.on(Quill.events.TEXT_CHANGE, (delta) => {
for (var i=0; i < delta.ops.length; i++) {
if ((delta.ops[i].attributes !== undefined) && (delta.ops[i].attributes.token !== undefined)) {
console.log('CORRUPTED!')
console.dir(delta.ops)
}
}
})
Go to the code block section in the sample editor and start adding code manually by typing it into the code block. You'll need to type quite a few functions, variables, etc since it doesn't occur every edit. But you'll eventually get it.
Expected behavior:
Adding code to the code block shouldn't result in any attributes other than "code-block": true being emitted as part of the text-change event.
Actual behavior:
A "token" attribute is sometimes incorrectly emitted with values like "function", "keyword", etc.
Platforms:
Chrome 67 on Mac 10.13.5
Version:
1.3.6
The text was updated successfully, but these errors were encountered:
After implementing syntax highlighting in a code-block, I noticed that as you type code into the code block, on occasion the Quill text-change event incorrectly emits a "token" attribute as part of it's delta. This doesn't occur with every edit in the code block, but occurs rather frequently.
The issue is the "token" attribute shouldn't be emitted at all as part of the text-change event since syntax highlighting shouldn't have any effect on the generated delta.
Here is a video going through the below repro steps and reproducing the issue: https://cl.ly/2x440N2z230V
Any idea what's going on? Or workarounds? Thanks!
Steps for Reproduction
Expected behavior:
Adding code to the code block shouldn't result in any attributes other than "code-block": true being emitted as part of the text-change event.
Actual behavior:
A "token" attribute is sometimes incorrectly emitted with values like "function", "keyword", etc.
Platforms:
Chrome 67 on Mac 10.13.5
Version:
1.3.6
The text was updated successfully, but these errors were encountered: