7
\$\begingroup\$

Syntax highlighting! Mike asked this question on SO, and the code looks like this:

enter image description here

Then he moved the question to EE, which is sensible, because we're so much smarter than them on SO, but here his code looks like this:

enter image description here

What happened to the syntax highlighting?

\$\endgroup\$
2
  • \$\begingroup\$ Contacted community managers, it was the c. Edited in, better? \$\endgroup\$
    – Kortuk
    Aug 2 '12 at 14:51
  • \$\begingroup\$ @Kortuk - Yes, it's OK now. Thanks. \$\endgroup\$
    – stevenvh
    Aug 2 '12 at 15:03
5
\$\begingroup\$

Most of our source code questions don't specify a programming language in the tags. I'm not sure if we want every question that has code in it to be tagged with a language, but there is a simple workaround - you can add a header to force a language.

For reference, see the syntax highlighting for code segment of the advanced editing help guide. The only language that we use that isn't supported is Verilog.

\$\endgroup\$
5
  • \$\begingroup\$ I am of the feeling that if it involves programming tagging it with the language is valuable, but that may be just me! \$\endgroup\$
    – Kortuk
    Aug 2 '12 at 15:04
  • \$\begingroup\$ @Kortuk heh... more tag cleanup :). Can we set a default code formatting for arduino? \$\endgroup\$
    – W5VO
    Aug 2 '12 at 15:08
  • \$\begingroup\$ They mostly already have the correct formatting, but things like arduino do not, good call. \$\endgroup\$
    – Kortuk
    Aug 2 '12 at 15:38
  • \$\begingroup\$ Has anyone posted a request for Verilog code highlighting on the Markdown/SO meta sites? \$\endgroup\$ Aug 16 '12 at 15:25
  • \$\begingroup\$ @SimpleCoder The issue is that there are not formatting rules for Verilog in the Google Prettify project. You would first need to have a syntax ruleset designed by the Prettify project before it could be implemented here. \$\endgroup\$
    – W5VO
    Aug 16 '12 at 15:31
4
\$\begingroup\$

Syntax highlighting rules are decided by what language the question is tagged with. Sadly the source question has already been deleted, so I cannot see what tags it had but there should be a tag that gives the necessary highlighting. If not, moderators can tie tags to certain programming language highlighting.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ I still have the original question open on one of my Firefox 50 tabs :-). It's indeed tagged "c". \$\endgroup\$
    – stevenvh
    Aug 2 '12 at 15:02
  • \$\begingroup\$ @stevenvh not sure why c was dropped. \$\endgroup\$
    – Kortuk
    Aug 2 '12 at 15:04
  • \$\begingroup\$ When you copy the body text of the question you can't include the tags. He remembered two of them, just forgot the third. \$\endgroup\$
    – stevenvh
    Aug 2 '12 at 15:06
  • 1
    \$\begingroup\$ @stevenvh that is not the proper way to move a post. It should have been migrated from SO. A flag to a moderator requesting it would have had a moderator handle it. It would also show up in statistics. That is more similar to cross posting which is not encouraged. \$\endgroup\$
    – Kortuk
    Aug 2 '12 at 15:39
  • \$\begingroup\$ I know all that, tell it to Mike! :-) I told him about the cross posting. \$\endgroup\$
    – stevenvh
    Aug 2 '12 at 15:41
  • \$\begingroup\$ @stevenvh Ohh, well then. I blame W5VO for this confusion. \$\endgroup\$
    – Kortuk
    Aug 2 '12 at 15:44
  • 1
    \$\begingroup\$ Yeah, these new moderators are a godsend ;-) \$\endgroup\$
    – stevenvh
    Aug 2 '12 at 15:47

You must log in to answer this question.

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