8

On the help page for Markdown Editing, in the Syntax Highlighting section, it specifies to use this format for hinting at a language:

<!-- language: lang-js -->
    setTimeout(function () { alert("JavaScript"); }, 1000);

But this fails to work - you need to include a blank line:

<!-- language: lang-js -->

    setTimeout(function () { alert("JavaScript"); }, 1000);

I was unsure if this was a bug in the Prettify plugin, or a documentation issue, hence raising it here.

0

2 Answers 2

8

This is a documentation bug.

It used to be correct, but then someone one day removed all newlines from the samples in that page, and when they were put back, they didn't quite manage to put the double newline in those samples back.

Also see What is syntax highlighting and how does it work? on Meta.SE.

3
  • Thanks. Not sure of the protocol here on meta - should I mark this as the answer, or does it need to wait until it's actually fixed? Commented Dec 2, 2014 at 20:44
  • @JamesThorpe: Marking something as helpful is entirely up to you; if you want to change your mind later that is also fine. The 'accept' mark has little meaning here really. Commented Dec 2, 2014 at 20:47
  • Ok. Wasn't sure if accepting an answer would "hide" the bug report - but after reading around, it seems like it's based on it not having one of the "official" red tags applied to the OP. Commented Dec 3, 2014 at 8:37
1

This will be fixed in build rev 2014.12.3.2819 on meta and 2014.12.3.2062 on sites.

3
  • This has not been fixed, I'm afraid, see stackoverflow.com/editing-help. Or rather, there is a new issue there with the code formatting samples in that a few newlines are still missing (the initial line whitespace is marked up but joined to the preceding line). Commented Jan 30, 2015 at 13:51
  • @MartijnPieters the particular example from this question is already fixed, this is what I see. A fix for the 2 samples under code formatting will go live in sites build rev 2015.1.30.2259
    – m0sa
    Commented Jan 30, 2015 at 15:01
  • Yes, I meant the 2 samples under code formatting; sorry if I gave the impression the samples in the question here were b0rken again, they were still correctly spaced. Thanks for fixing those samples! Commented Jan 30, 2015 at 15:03

You must log in to answer this question.

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