Canvas: tab-size in code blocks not set correctly

Steps to reproduce

Add a new card to a Canvas. Add code block:

```
1234567890
	Line starts with a tab
1234567890
```

Compare card in Live Preview and Reading View

Expected result

Tab is displayed with same indentation in both views.

Actual result

  • Indentation in Live Preview is as expected (4 characters)
  • Indentation in Reading View is wider than expected (8 characters)

tab

Environment

SYSTEM INFO:
Obsidian version: v1.6.7
Installer version: v1.6.5
Operating system: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 23.5.0
Login status: logged in
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

Additional information

According to W3C specs the initial value for tab-size is 8 characters: CSS Text Module Level 3

Reading view of Markdown notes sets tab-size explicitly to 4.

This setting seems be missing in Canvas.

Workaround

Add tab-size explicitly with a CSS snippet that sets tab-size to 4 for .markdown-embed-content.