2

How can I highlight deleted and added lines like in this comment? How do I make it look like a git diff?

Do I have to use HTML? Or is there some tricky syntax like strikethrough?

5

That is done by using a code block with the "diff" syntax. The raw markdown would look something like this:

One small step for 
```diff
-man
+humankind
```

I've made a gist also that demonstrates the code (click "Raw" to view the markdown).

  • Thanks! Not knowing this had been bugging me for a long time. Out of curiosity, where is this documented? I couldn't find it anywhere. – Ashitaka May 29 '14 at 13:43
  • You can see the complete list of languages they do syntax highlighting for here: github.com/github/linguist/blob/master/lib/linguist/… It is so long, diff was bound to be there! – John C May 30 '14 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.