First time here? Check out the FAQ!
1

Expand syntax highlighting support to allow named language?

Askbot includes support for syntax highlighting using google-code-prettify (GCP), but doesn't offer an option to specify a particular language.

As a result, this bash code formats nicely:

#!/bin/bash
echo "Foo bar"

But this BASIC code has some problems:

Sub FooBar
  Dim CountInteger As Integer  'For counting a thing
  Dim OtherInteger As Integer
  CountInteger = Blah / 2
  REM Do some stuff here 
  OtherInteger = 5
End Sub

There is already a mechanism within GCP to specify a language:

"You can specify a language by specifying the
language extension along with the prettyprint
class like so:

<pre class="prettyprint lang-html">
...

Here's the markdown-ish syntax GitHub uses to indicate language-specific syntax-highlighting:

```ruby
ask = "bot"
puts "#{ask}: loopbackoffice"
```

This sounds like a relatively straight-forward improvement.

qubit's avatar
108
qubit
asked 2013-02-19 17:56:23 -0500, updated 2013-02-19 18:22:05 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

More likely we will refresh the version of the editor. I've looked at what Stackoverflow does these days for the syntax highlighting and they use a special comment for the cases where the language cannot be guessed <!-- lang: lang-name--> - on the preceding line of the code block.

In order to adopt that editor we'd also need to reconcile the potential new version with our changes: i18n and file attachments (and maybe some other things).

Evgeny's avatar
13.2k
Evgeny
answered 2013-02-22 17:54:47 -0500
edit flag offensive 0 remove flag delete link

Comments

> they use a special comment for the cases where the language cannot be guessed &lt;!-- lang: lang-name--&gt;

How would a user specify a particular language? Hopefully the markup would be something simple, like the syntax used by GitHub above.

qubit's avatar qubit (2013-02-26 14:56:06 -0500) edit
add a comment see more comments