2

Syntax highlighting works fine (on Github):

```html
<script scr='/foo.js'>
```

Is it possible to use syntax highlighting without fencing?

For example, `<script scr='/foo.js'>`

2 Answers 2

2

It's unclear from your question whether you want inline syntax highlighting on the github.com site itself, or whether you want inline syntax highlighting on an arbitrary site that happens to support the github variant of markdown.

If it's the former, then, no, github.com won't currently add syntax highlighting to inline code.

If it's the latter, then it depends on the particular tool that you're using to convert markdown to HTML. Pandoc, for example does support syntax highlighting for inline code.

Sign up to request clarification or add additional context in comments.

1 Comment

I wanted to use it on github.com, but the extra info is useful.
1

You can't have syntax highlighting on github with inline code blocks or space-indenting, only with fencing.

2 Comments

You might add that the reason is that there is no way to identify the language of the code block on anything except fenced code blocks. Yes, some highlighting scripts can guess, but that is not always reliable -- especially on short code snippets found in inline code blocks.
Why can't there be a way to identify the language? Like: ruby`puts :OK`

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.