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:

When entering XML literals using E4X syntax in ActionScript the code highlighting can be broken:

package
{

public class XMLTest
{
    public function XMLTest()
    {
       // here highlighting works ok
       var aVariable:int = 0;
       var aSprite:Sprite = new Sprite();

        var xmlFragment:XML = 
        <root>
           <node />
           <node />
           <node />
        </root>;

       // from now on all code highlighting is borked
       var otherVariable:int = 0;
       var yetAnother:Sprite = new Sprite();
    }
}
}

There is a workaround:

package
{

public class XMLTest
{
    public function XMLTest()
    {
       // here highlighting works ok
       var aVariable:int = 0;
       var aSprite:Sprite = new Sprite();

        var xmlFragment:XML = 
        <root>
           <node />
           <node />
           <node />
        </root>; // / //<-- resets the parser and code remains valid

       var otherVariable:int = 0;
       var yetAnother:Sprite = new Sprite();
    }
}
}
share|improve this question

marked as duplicate by ben is uǝq backwards, ChrisF Jun 16 '13 at 10:00

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.

2 Answers 2

We just deployed the latest trunk of prettify.js ; revision 83

http://code.google.com/p/google-code-prettify/source/browse/trunk/src/prettify.js

share|improve this answer
    
But we still can't specify the language in our posts. –  Svante Oct 20 '09 at 20:14
    
When can we expect to specify the language as an 'advanced' feature so as to fix these syntax highlighting problems? –  staticx Aug 30 '10 at 0:31

I have rarely seen it work with non-trivial Perl code.

Which is one language Prettify is supposed to work with.


It is difficult to get a parser to parse Perl correctly, but Prettify doesn't even work for "Quote like operators".


for( qw( a b c ) ){ ... }
for( qw[ a b c ] ){ ... }
for( qw{ a b c } ){ ... }
for( qw/ a b c / ){ ... }

Should be highlighted more like this:

for( qw' a b c ' ){ ... }

All of those examples do exactly the same thing.

I Will also note that they all highlight correctly using Gedit.

share|improve this answer
2  
Parsing the vomit after eating alphabet soup is never going to be easy. Especially not when trying to support every other language as well. –  GEOCHET Aug 20 '09 at 17:11
1  
Haha, Perl sucks! (Sorry Perl guys) –  jjnguy Aug 20 '09 at 17:13
    
@Rich I am so using this line in the future –  squillman Aug 20 '09 at 17:13
    
jjnguy's comment is obviously supposed to be a joke. –  Brad Gilbert Aug 20 '09 at 18:46
    
Prettify has never claimed that it works with perl. Though I'm happy to accept patches. –  Mike Samuel Dec 10 '09 at 18:18
    
It highlights use correctly which as far as I know is only used by Perl. –  Brad Gilbert Dec 10 '09 at 20:29

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