Page MenuHomePhabricator

Highlighting code block with diff formatting
Closed, ResolvedPublic

Asked by sshannin on Sep 7 2015, 3:02 PM.

Details

I'm pasting a text diff in standard format in a comment. I would like to highlight it as a diff (adds/removes different colors).

When viewing other files, I can do Highlight As -> Diff, but when pasting my block comment, nothing seems to happen if I do lang=Diff. Is there any way to make that block render as a diff.

Example:

97c82,83
< a
---
> b

Summary: it actually is highlighting the --- section marker, which I didn't notice. It's just a mostly useless highlight.

Answers

cspeckmim
Updated 1,528 Days Ago

According to the Remarkup Reference to use syntax highlighting you need to have Pygments enabled along with using the syntax:

```lang=diff
97c82,83
< a
---
> b
```

I tried this on my system and it appears to highlight, as it does in the example you have above (the three hyphens appear red).

New Answer

Answer

This question has been marked as closed, but you can still leave a new answer.