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

None of these appear to be working... Edit to see the ways and means it fails.

language: lang-sql, no indent on Prettify comment

Select * from Foo where Foo.bar == "baz"

language: sql, no indent on Prettify comment

Select * from Foo where Foo.bar == "baz"

language: lang-sql, Prettify comment indented

<!-- language: lang-sql -->
Select * from Foo where Foo.bar == "baz"

language: sql, Prettify comment indented

<!-- language: sql -->
Select * from Foo where Foo.bar == "baz"
share|improve this question
1  
Today I learned you can put a language comment in code as a hint for Prettify. –  Justin Morgan May 9 '11 at 14:07
    
@JustinMorgan: Congrats. How do you do this? –  Won't May 9 '11 at 14:10
    
Ahhhhh...about that. I meant "today I learned from Will don't give a's question on Meta, where he posted a code sample." Meaning your code above. Does it work for, say, C# at least? –  Justin Morgan May 9 '11 at 14:12
1  
    

2 Answers 2

up vote 11 down vote accepted

The language comment shouldn't be indented and you should put a blank line between the comment and the code

<!-- language: lang-sql -->

    Select * from Foo where Foo.bar == "baz"

This should yield

Select * from Foo where Foo.bar == "baz"

The highlight is pretty subtle though.

share|improve this answer
    
True. Or, I guess more precisely one could say: Markdown code blocks need a blank line before and after it to distinguish it from other Markdown parts. –  Arjan May 9 '11 at 14:29

Well, I learned something new today, and apparently this does work for C#.

As you can see, SQL is included in the official language list. So it should work. One thing that might come into play is that the tagging format is a little tricky, and took me a couple of tries to get right. Your Prettify comment should be on its own line, but not indented. Then your (indented) code goes two lines below it. If you look at the source code of Jeff's answer in the link above, you can see how to do it.

If you've already tried that and it didn't work, then you've got yourself a bug.

Test:

Select * from Foo where Foo.bar == "baz"

Source:

<!-- language: lang-sql -->

    Select * from Foo where Foo.bar == "baz"

Update: Looks like it works.

share|improve this answer

You must log in to answer this question.

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