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

Error in syntax highlighting over multiple lines in java. #592

Closed
larstvei opened this issue Sep 30, 2014 · 4 comments
Closed

Error in syntax highlighting over multiple lines in java. #592

larstvei opened this issue Sep 30, 2014 · 4 comments

Comments

@larstvei
Copy link

In the second code-block you can see that multiple lines of comments are interpreted as a single line comment.

10578849_10154652121560484_1162312719_o

@espenak
Copy link
Member

espenak commented Oct 27, 2014

I have tried to find the root cause of this issue. I think this is due to syntax errors other places than in the comment. For example, this is highlighted correctly by the Java, C and C++ highligters:

/** This
is a
test */


/*
Hello
world
*/

I do not think we can assume that the Pygments library should be able to correctly highlight code with syntax errors.

@henrist
Copy link

henrist commented Nov 6, 2014

From what I can see the error is in the first line, before the comment. The starting curl for the else if is in string-color, so it seems like the escape for ' (the \' part) failed, so it think the string starts there. On the next ' in the first line of comment, the string stops, therefor the comment never really started.

@espenak
Copy link
Member

espenak commented Nov 6, 2014

I just tested the following example:

if(x == '\'') {
    /* It's happening
    Hello world
    */
}

in the Try it out box at the bottom of the pygments website, and it works fine. I would appriciate help with finding the root cause of this issue. I guess we just have to try until we find out what causes the error. At that point we can open a ticket with pygments and see if they can help us out.

@torgeirl
Copy link
Collaborator

I believe this issue got handled in the UI overhaul included in Devilry 3.x (released January 2018), and if not we're currently in the process of replacing the editor included in Devilry 3.x (#1217) with the intention of also improving both code and math block notation.

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

4 participants