6

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"
5

2 Answers 2

11

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.

1
  • 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, 2011 at 14:29
0

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.

You must log in to answer this question.