What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

The interface keyword is not being highlighted. Even though the code block is recognized to be Java, the interface keyword is marked up by Prettify to be a plaintext.

public interface YUNoHighlightMe {
    void someMethod();
}

Examples from SO:


Edit:

After a comment suggesting to test it out locally with Prettify, I did. The code used (+ latest downloadable Prettify):

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <link href="prettify.css" type="text/css" rel="stylesheet" />
        <script type="text/javascript" src="prettify.js"></script>
    </head>
    <body onload="prettyPrint()">
        <pre class="prettyprint lang-java">public interface YUNoHighlightMe {
    void someMethod();
}</pre>
    </body>
</html>

This confirms the Prettify bug as it does not highlight the keyword.

The interesting part is that if I omit the lang-java language hint, it works well and the word gets highlighted.

share|improve this question

closed as off topic by Manishearth, Anna Lear Jul 1 '12 at 9:12

Questions on Meta Stack Exchange are expected to relate to the software that powers the Stack Exchange network within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
throw new NamingConventionViolationException("yUNoHighlightMe"); –  Daniel Fischer Jul 1 '12 at 4:41
4  
You seem to realize that the syntax highlighting is handled by Prettify; why are you filing this here? File it against Prettify –  Michael Mrozek Jul 1 '12 at 4:41
1  
@MichaelMrozek Oh, right. I kinda thought SE was using it's own version or maybe some other inner mechanism was interfering with it. Those assumptions... I'll file it and post it here as an answer ASAP. –  Slanec Jul 1 '12 at 4:46
    
@slanec you're right there, sometimes MarkDown does interfere with prettify and mathjax. In that case, first test it out in a pure prettify environment and then determine where the bug is to be filed. –  Manishearth Jul 1 '12 at 8:00
    
@ManishEarthwantsmorewaffles Now that's what I wanted to hear. The local test confirmed the bug, details in the updated question. –  Slanec Jul 1 '12 at 8:22

1 Answer 1

up vote 7 down vote accepted

The bug has been filed on the Prettify project:

http://code.google.com/p/google-code-prettify/issues/detail?id=225


EDIT (Feb 2013): Fixed at the Prettify side.

share|improve this answer
2  
"The interesting part is that if I omit the "lang-java" language hint, it works well and the word gets highlighted." I guess this way Prettify authors try to communicate their belief that in Java, interfaces are designed the wrong way :) –  gnat Jul 1 '12 at 14:22

Not the answer you're looking for? Browse other questions tagged .