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.

This question already has an answer here:

The C# highlighter (and possibly others) chokes on non-ASCII characters in class names, as can be seen in this post:

Trouble with if circulating

enter image description here

EDIT: Prettify bug report submitted.

share|improve this question

marked as duplicate by ben is uǝq backwards, Rory, animuson, Lucifer, Hugo Dozois Jun 16 '13 at 4:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

7  
Don't work with whoever wrote that. –  Mysticial Mar 7 '13 at 7:37
2  
Submit a bug report to Prettify? –  animuson Mar 7 '13 at 7:39
    
@animuson: done. –  nneonneo Mar 7 '13 at 7:44

2 Answers 2

A comment in the code the default parser marks it as a known shortcoming in Prettify:

fallthroughStylePatterns.push(
    // TODO(mikesamuel): recognize non-latin letters and numerals in idents
    [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
    [PR_TYPE,        /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null],
    [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
...

By "non-latin," I think it really means non-ASCII. Fixing it would involve changing not just the statement quoted above, but several places where patterns like a-z or a-zA-Z appear. Prettify does some case-folding as part of its processing of regular expressions, and I imagine that contributes to making this a non-trivial problem to solve.

share|improve this answer

While I agree that's a bug (and I agree with the comments...that's bad code as well), it's one that would need to be fixed on the prettify side. Given this is the first time I've seen this though, I wouldn't wager they'll fix it unless they can do so in a way that doesn't suffer performance-wise for this edge case.

share|improve this answer

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