Canvas card YAML frontmatter manifests as a blank first line in reading mode

Bug description

When viewing cards in a canvas, cards with YAML frontmatter have a blank initial line that pushes the start of the card’s actual content to the second line. This differs from regular notes, where YAML frontmatter is completely zero-impact in reading mode (i.e., two notes with identical content would appear the same in reading mode even if one of the two also had YAML frontmatter).

Steps to reproduce

  1. Add a card to a canvas with at least one line of content (e.g., regular text)
  2. Add a YAML frontmatter section to the card
  3. Click out of the card to exit editing mode

Expected result

Frontmatter section turns invisible in reading mode (i.e., when card is not being edited); its presence has no impact on the line positions of the card’s content.

Actual result

Frontmatter section turns invisible in reading mode but appears to manifest as a single blank line before the card’s content, causing the content to begin on the card’s second line.


Obsidian version: v1.2.3
Installer version: v1.1.9
Operating system: Darwin Kernel Version 21.6.0: Sun Nov 6 23:31:16 PST 2022; root:xnu-8020.240.14~1/RELEASE_X86_64 21.6.0
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on

Additional information

  • The screenshot below shows this behavior in the sandbox vault. The card being edited at the top becomes the bottom-left card when no longer being edited. Note the placement of the word “Text,” which is shifted lower compared to an equivalent card with no YAML frontmatter (bottom-right).
  • I’ve duplicated this behavior in macOS, iOS, and Windows.



Just to be thorough and sure, I repeated the test from the screenshot with properly formatted YAML and got the same result.

Anyone also seeing this or able to duplicate?

1 Like


Same here. A minor issue but very annoying. Does anyone have a fix?

The issue happed more serious after I updated to v1.3.7

See as the picture:

I found a decent workaround using the Minimal theme with the Style Settings plugin but it does affect the styling of notes outside canvas.

Go to Style Settings plugin > Minimal > Text > and set Heading Spacing to 0 (default is 2em)