How can I stop ![[...]] embeds from being hidden in Live Preview?

Hi everyone,

I’m using Obsidian in Live Preview, and I noticed that when I write an embed like ![[note]], the link syntax is hidden unless I click on that line.

What I want is:

  • the ![[...]] text to stay visible all the time

  • while the embedded content also stays expanded / rendered

  • ideally without having to switch to Source mode

Right now, it seems Obsidian automatically hides the embed syntax and only shows it when the cursor is on that line.

Is there any way to prevent this behavior?

I’m wondering whether there is:

  • a built-in setting

  • a CSS snippet

  • a plugin

  • or any workaround that makes Live Preview behave more like this

For example, I want something closer to:

  • embed syntax always visible

  • embed content not collapsed

  • no need to click the line just to see ![[...]]

I attached a screenshot for reference.

Any help would be appreciated. Thanks!

1 Like

There isn’t a built in setting. I believe a CSS snippet can do it. If you search the forum and Discord, you might find one. If you don’t find any for exactly what you want, a snippet that shows any hidden syntax in Live Preview would give you a starting point to adapt.

2 Likes

Yeah, I don’t know a way to stop them from being hidden, but we can kind of fake it with some CSS. If you don’t add any alt/attribute text, the link content will show as is, but you can add your own text using attribute text. e.g.
![[321-note| the 321 note, yay!]]

.markdown-source-view .internal-embed:not(.media-embed)::before { 
    content: attr(alt); 
    font-size: 1em; 
    font-weight: 400; 
    color: hotpink; 
    padding-left: 1.5em; 
}
  • hotpink for demonstration of what’s added; probably want to change that. :smiley:
  • remove .markdown-source-view to have them shown in reading view as well (but it doesn’t sound like you want that)
  • change the content to content: "[["attr(alt)"]]" if you wanted to fake the brackets


Here are some previous versions:

https://forum.obsidian.md/t/how-to-get-embedded-notes-to-use-the-modifier-for-the-title/99889/2

https://forum.obsidian.md/t/displaying-embedded-file-content/69337/3

https://forum.obsidian.md/t/is-there-a-way-to-show-pdf-file-name-while-it-is-displaying/98121/6

1 Like