Inconsistent/different code syntax highlight when toggling view/edit view

Steps to reproduce

Write the following in a new page:

```ruby
arr = [1,2,3]
def foo(var)
  puts var.size
end
```

```yml
# docker-compose.yaml
version: '3'
version2: 3
services:
  mypostgres: # name
    image: 'posgres'
    image2: posgres
    ports:
      - 5438:5432
#      - 5432:5432      - 
    environment:
      POSTGRES_PASSWORD: db_pass
      POSTGRES_USER: db_user
      - POSTGRES_DB=db_name
    volumes:
      - db-data:/var/lib/postgresql/data # check where psql stores data
volumes:
  db-data:
    driver: local

```

Then toggle edit mode and view mode:
image

Expected result

That both view mode and edit mode will show a consistent good syntax highlight,
for both ruby and yaml (and other programming languages as well)

Good Ruby highlight? Only in edit mode
Good Yaml highlight? Only in view mode

Can’t I have both?

At least make it so the view mode has both good ruby and yaml syntax
so I won’t be force to switch all the time.

Actual result

The Ruby block highlight only works in edit mode
The Yml block highlight only work in view mode

Can’t have both ruby and yml show a good syntax highlight in same mode

Environment

  • Operating system:
    Running pop os 22:04 which is Ubuntu based

cat /etc/*release

DISTRIB_ID=Pop
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Pop!_OS 22.04 LTS"
NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-os
  • Debug info:

SYSTEM INFO:
Obsidian version: v1.1.16
Installer version: v1.1.16
Operating system: #202212290932~1674139725~22.04~ca93ccf SMP PREEMPT_DYNAMIC Thu J 6.0.12-76060006-generic
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 2
Plugins enabled: 2
1: Advanced Tables v0.18.1
2: Excalidraw v1.8.14


Additional information

Edit mode: good ruby highlight but bad yaml highlight

View mode: good yaml highlight but bad ruby highlight:

yes, there are inconsistencies because two different parsers are at play. I don’t see this changing anytime soon. Sorry!