4

Hints like

<!-- language: lang-perl -->

work fine with top-level code blocks, but there seems to be no way to influence the rendering of code posted within blockquotes

I realise that this probably means that there isn't a way, but I thought it was worth asking the question as Stack Overflow has repeatedly surprised me with arcane techniques

I have resorted to using

<!-- language-all: lang-none -->

before the blockquote, but that restricts me to only one syntax per blockquote, and also needs resetting at the end of the blockquote to restore the default

1 Answer 1

5

It is possible to specify the language of individual code blocks within blockquotes. You do this by specifying the hint as part of the blockquote. For example:

> Hello World in Perl:

> <!-- language: lang-perl -->

>     print "Hello world!";

Result:

Hello World in Perl:

print "Hello world!";
1
  • Thank you. I was sure I'd tried every combination, but seemingly not this one. So simple
    – Borodin
    May 23, 2016 at 8:40

You must log in to answer this question.

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