# Can I highlight some text in a fenced code block?

**URL:** https://meta.discourse.org/t/can-i-highlight-some-text-in-a-fenced-code-block/32022
**Category:** Support
**Created:** [8월 12, 2015, 11:30오전 UTC](https://meta.discourse.org/t/can-i-highlight-some-text-in-a-fenced-code-block/32022 "2015-08-12T11:30:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Kristen](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kristen](https://meta.discourse.org/u/Kristen)
#### Post date: [8월 12, 2015, 11:30오전 UTC](https://meta.discourse.org/t/can-i-highlight-some-text-in-a-fenced-code-block/32022/1 "2015-08-12T11:30:46Z")

</div>

In a Discourse forum for techies discussing code in a specific language I’d like to be able to highlight something in a code block. For example the O/P posts some, broken, code and I fix it up. The user has to carefully read my improved code to see what I have changed, and putting a comment in the code like:

xxx = yyy \<— I MADE A CHANGE HERE

is a bit lame!, particularly on a complex line.

I suppose, ideally, it would just be a background colour to highlight a section, but if it was possible to put some sort of [color=red] or similar tags into the code that would provide more facilities to people which more artistically then me!

---

<div class="post-metadata">

### Author: ![rumpelsepp](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@rumpelsepp](https://meta.discourse.org/u/rumpelsepp)
#### Post date: [8월 12, 2015, 11:45오전 UTC](https://meta.discourse.org/t/can-i-highlight-some-text-in-a-fenced-code-block/32022/2 "2015-08-12T11:45:48Z")

</div>

What about diff?

```diff
diff --git a/pynote/formatting.py b/pynote/formatting.py
index f0d7d53..eda1906 100644
--- a/pynote/formatting.py
+++ b/pynote/formatting.py
@@ -1,5 +1,5 @@
 import click
-from pynote import config
+from . import config
 
 
 def echo(text, no_pager=False):

```

---

<div class="post-metadata">

### Author: ![StanD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stand/32/115977_2.png) [@StanD](https://meta.discourse.org/u/StanD)
#### Post date: [2월 25, 2016, 12:38오전 UTC](https://meta.discourse.org/t/can-i-highlight-some-text-in-a-fenced-code-block/32022/3 "2016-02-25T00:38:50Z")

</div>

This is something I am looking for but can you tell me how you did this? That is, how do you format in the editor to get this to display?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 25, 2016, 1:02오전 UTC](https://meta.discourse.org/t/can-i-highlight-some-text-in-a-fenced-code-block/32022/4 "2016-02-25T01:02:19Z")

</div>

```diff
line 1
line 2
+line 3
-line 4
line 5

```

````
``` diff
line 1
line 2
+line 3
-line 4
line 5
```

````

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [12월 22, 2018, 11:53오전 UTC](https://meta.discourse.org/t/can-i-highlight-some-text-in-a-fenced-code-block/32022/5 "2018-12-22T11:53:51Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [1월 21, 2019, 12:06오후 UTC](https://meta.discourse.org/t/can-i-highlight-some-text-in-a-fenced-code-block/32022/6 "2019-01-21T12:06:25Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
