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 does not correctly highlight multi-line comments #723

Closed
micimize opened this issue Jun 2, 2016 · 5 comments
Closed

Syntax module does not correctly highlight multi-line comments #723

micimize opened this issue Jun 2, 2016 · 5 comments

Comments

@micimize
Copy link

micimize commented Jun 2, 2016

Reproducable with the example editor at beta.quilljs.com:
screen shot 2016-06-02 at 16 40 16

We should wrap them in a single <pre/> similar to how lists are wrapped by <ol/>:
screen shot 2016-06-02 at 16 43 15

@jhchen jhchen changed the title code blocks are only one line long Syntax module does not correctly highlight multi-line comments Jun 7, 2016
@jhchen
Copy link
Member

jhchen commented Jun 7, 2016

One line blocks are not a problem by itself. There are many benefits to it such as consistent newline creation/deletion, at any position across all supported platforms, which is why the implementation choice was made in the first place. The incorrect highlighting for multiline is the target bug that needs to be fixed, which may or may not be done with a one line per block implementation.

@micimize
Copy link
Author

micimize commented Jun 7, 2016

I don't think there's a solution for consistent multi-line highlighting that doesn't run into the same problem / trade-off, just like you get with lists. We could make the code-block merging configurable, or make such merging strategies configurable in general.

One thing I tried was making code-block a wrapper around code-lines, but that was a bit painful, and was really hard to fit to the current highlighting strategy.

@jhchen
Copy link
Member

jhchen commented Jun 7, 2016

I'm not ready to give up on a solution yet and force all Quill users to make a configured tradeoff. The solution may not be apparent yet but that does not mean it does not exist.

@auralon
Copy link

auralon commented Jun 14, 2016

This is exactly the issue that I came across, although I noticed it with the blockquote tag too, which certainly doesn't have the same knock-on effects (when used in conjunction with other tools like highlight.js), but if behaviour is changed for pre tags, then it might as well be altered for blockquote too.

@jhchen jhchen closed this as completed in 7cc1683 Jul 7, 2016
@auralon
Copy link

auralon commented Jul 7, 2016

Looking forward to this being released as a beta build.

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

Successfully merging a pull request may close this issue.

3 participants