Syntax highlighting for sh code blocks disappears in Reading View

Steps to reproduce

  1. Create new Vault
  2. Enter the following code
```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? Y

Expected result

Syntax highlighting to remain.

Actual result

Syntax highlighting disappears.

Environment

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

Reading View

1 Like

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.

1 Like

The reason I found this was actually trying to use the 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

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