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

I'm still searching for an exising bug report on the google prettify bug list page and I will add one if none exist, but I thought someone here might like to know as well.
It seems that XML attributes containing < break the syntax highlighting for just that line. Check out the third line in the code from my answer to Editing crontab remotely with ant sshexec doesn't not work:

<target name="remove-crontab">
    <echo message="Removing Crontab" />
    <sshexec host="${host}" username="${username}" password="${password}" command="crontab < /dev/null" trust="true" failonerror="false" />
</target>  

Even when using: <!-- language: lang-xml -->

The bug is not showing in the code above as I am writing this question, so you might need to look at the SO post unless question previews just dont get prettified until the Q is posted..?

share|improve this question
4  
The bug is not in prettify, the bug is in the XML. That is not a valid XML file. It should be encoded as a character entity (&lt;). –  Jeff Mercado Nov 6 '11 at 20:29
    
Oh, well, I learned something today! :) –  chown Nov 6 '11 at 20:33
    
Of course, highlighting doesnt matter much to the OP as long as the question is answered, but, out of curiousity, is there no way to display a < in an attribute inside a code format block (w/ highlighting). Because crontab &lt; /dev/null just looks weird. –  chown Nov 6 '11 at 20:42
    
There isn't supposed to be a < in that location if it should be wellformed XML, so displaying < would just be misleading. crontab &lt; /dev/null might look wired to you, but crontab < /dev/null will look like broken XML to whatever program is supposed to process it. It's the same as with backslash escapes in strings. For example displaying "ab"cd" instead of "ab\"cd" won't do any good. –  sth Nov 6 '11 at 22:52

1 Answer 1

up vote 5 down vote accepted

XML attributes with literal < in them also break XML, so that's not surprising.

share|improve this answer
    
Did not know this, thanks Tim! –  chown Nov 6 '11 at 20:34

You must log in to answer this question.

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