# Syntax highlighting for sh code blocks disappears in Reading View

**URL:** <https://forum.obsidian.md/t/syntax-highlighting-for-sh-code-blocks-disappears-in-reading-view/76575>\
**Category:** Help\
**Tags:** ui-ux\
**Created:** [February 8, 2024, 5:07pm UTC](https://forum.obsidian.md/t/syntax-highlighting-for-sh-code-blocks-disappears-in-reading-view/76575 "2024-02-08T17:07:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fhammar](https://forum.obsidian.md/user_avatar/forum.obsidian.md/fhammar/32/60849_2.png) [@fhammar](https://forum.obsidian.md/u/fhammar)\
**Post date:** [February 8, 2024, 5:07pm UTC](https://forum.obsidian.md/t/syntax-highlighting-for-sh-code-blocks-disappears-in-reading-view/76575/1 "2024-02-08T17:07:20Z")

</div>

### Steps to reproduce

1. Create new Vault
2. Enter the following code

````auto
```sh
echo hello
```

````

1. Notice that `echo` is highlighted yellow
2. Switch to reading view
3. Yellow highlight disappears

### Did you follow the [troubleshooting guide](https://forum.obsidian.md/t/about-the-bug-reports-category/24/10)? Y

### Expected result

Syntax highlighting to remain.

### Actual result

Syntax highlighting disappears.

### Environment

```auto
SYSTEM INFO:
	Obsidian version: v1.5.3
	Installer version: v1.5.3
	Operating system: #1 SMP PREEMPT_DYNAMIC Thu, 01 Feb 2024 10:30:35 +0000 6.7.3-arch1-1
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

```

* * *

### Additional information

It works as expected with `bash`.

#### Source Mode

 ![image](https://forum.obsidian.md/uploads/default/original/3X/f/3/f38c6831d7eaa3fa659c3a645a0809fe352733a0.png)

#### Reading View

 ![image](https://forum.obsidian.md/uploads/default/original/3X/5/6/5616876122f9e70a9b3a6139d4f82d3aaa53cb86.png)

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [February 8, 2024, 5:13pm UTC](https://forum.obsidian.md/t/syntax-highlighting-for-sh-code-blocks-disappears-in-reading-view/76575/2 "2024-02-08T17:13:36Z")

</div>

yes, the parsers between the views are different and the their support is different.

I am sure there are other cases like this. Hopefully one day we can use one parser for both views.

---

<div class="post-metadata">

**Author:** ![fhammar](https://forum.obsidian.md/user_avatar/forum.obsidian.md/fhammar/32/60849_2.png) [@fhammar](https://forum.obsidian.md/u/fhammar)\
**Post date:** [February 10, 2024, 1:10pm UTC](https://forum.obsidian.md/t/syntax-highlighting-for-sh-code-blocks-disappears-in-reading-view/76575/3 "2024-02-10T13:10:02Z")

</div>

The reason I found this was actually trying to use the [Execute Code](https://github.com/twibiral/obsidian-execute-code) with `sh`, and I suspect this issue in Obsidian is the root cause.

# The original issue

[Shell code works with `bash` but not `sh` · Issue #331 · twibiralobsidian/execute-code](https://github.com/twibiral/obsidian-execute-code/issues/331)

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [May 10, 2024, 1:10pm UTC](https://forum.obsidian.md/t/syntax-highlighting-for-sh-code-blocks-disappears-in-reading-view/76575/4 "2024-05-10T13:10:42Z")

</div>

Closed on May 10, 2024, 1:10pm UTC

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