slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.65k stars 3.39k forks source link

Proposed update to code handeling to support hljs better... #3981

Open artknight opened 9 months ago

artknight commented 9 months ago

I have implemented beta.2 in my app. However, I ended up making a couple of modifications to the syntax.ts and code.ts to better the hljs support. Here are my modifications below. I would like to suggest to implement those into the code module. Let me know your thoughts

Screenshot 2024-01-30 at 5 13 33 PM

and

Screenshot 2024-01-30 at 5 13 50 PM

Thanks, Art

luin commented 9 months ago

Hey @artknight 👋

What issues did you encounter in order to make those changes?

artknight commented 9 months ago

Hey @artknight 👋

What issues did you encounter in order to make those changes?

PRE makes sure the indentation persists.

removing that block of code, and replacing the highlight() method with highlightAuto() ensures the syntax highlighting.

Arthur

artknight commented 9 months ago

@luin

ludejun commented 6 months ago

You can use quill-react-commercial.

It makes code highlighting more professional. image

szlezakbartosz commented 4 months ago

Any updates on this? Can't make the syntax highlighting work...

artknight commented 4 months ago

@luin any chance my changes could make it into master?

ryor1986 commented 4 months ago

@luin I am having the same problem. Currently, we have no choice but to modify the original library code to use it, so it would be helpful if this problem could be resolved soon.

related issue: https://github.com/slab/quill/issues/4300

cc: @artknight