Make consecutive embeds in Reading view appear same as in Live Preview?

I just love how Live Preview (on the left) handles consecutive embeds–those not separated by an empty line appear as a single continuous embed, which makes it supremely useful for embedding consecutive blocks from other notes, especially list items!

Dec-19-2024 01-25-37

What’s great is that not all consecutive embeds have to turn into one big super-embed. I’m given choice: simply insert a blank line between two embedded links and voilà–they are now separated.

What I don’t love is how Reading view (below) robs me of such wonderful and desirable behavior and chops up my lovely super-embeds :roll_eyes:

In Reading view, I want consecutive block embed to appear exactly the same as in Live Preview. Is this possible? :pray:

A solution that would simply remove the gap between all consecutive emebds would not suffice–I need it where inserting a blank line between two embeds separates them while having no empty line between merges them.

1 Like

I only tested it out quickly, but you could give this a try:

.markdown-preview-view .inline-embed + br {
    display: none;
}

Obsidian_Jlv1TLgNrK

source | live preview | reading view

1 Like

Looks like that did it! This made my day, thank you so much! :hugs:

Sadly, The Minimal Theme breaks your solution, which works great with the default theme. Any idea how to reconcile it with Minimal? :thinking:

Side-note: how’d you get the LP icon in the tab title bar? Looks real useful!

I’d have a look what is happening in Minimal using the inspector.

1 Like

Cracked it! To merge consecutive embeds in the Minimal Theme:

.markdown-preview-view .markdown-embed {
  margin: 0;
}

.markdown-preview-view .inline-embed + br {
  display: none;
}

Ah, this makes me unreasonably happy!

A new foe appears!

Now it’s the other way around. Even with the snippet above ON, the embeds won’t appear as consecutive when in a callout or blockquote in Live Preview:

Compare to Reading view:

If anyone figures this out, please let me know! I refuse to believe I’m the only one who’s head over heels over merged embeds…

For callouts in Live Preview, a solution was shared by a kind soul on Discord:

.markdown-rendered .markdown-embed {
  margin: 0;
}
.markdown-rendered .inline-embed + br {
  display: none;
}
.HyperMD-quote > .markdown-embed {
  display: inline-block;
  width: 99.9%;
  vertical-align: middle;
}

Blockquotes in Live Preview turned out to be trickier, so the gaps were only reduced slightly, not fully:

Compare to with snippet OFF: