Bold internal links work in reading view but not in editing view

What I’m trying to do

Make internal links bold in both reading view and editing view via CSS snippets.
Currently bold internal links works only in reading view, but not in editing view

Things I have tried

My CSS snippet:

/* For internal links in the editing mode */
.cm-s-obsidian .cm-hmd-internal-link,
.cm-s-obsidian span.cm-hmd-internal-link {
    font-weight: bold !important;
}

/* For internal links in the reading (preview) mode */
.markdown-preview-view .internal-link {
    font-weight: bold !important;
}

Outcome:

Bold internal links appear only in reading view but not in editing view

Any ideas or suggestions to troubleshoot is much appreciated. Thanks!

Give this a try:

.cm-s-obsidian span.cm-hmd-internal-link,
.markdown-preview-view a.internal-link {
    --link-weight: 700;
}

Thank you for the above suggestion, but it did not work either :frowning:

I tried some troubleshooting with my original CSS snippet

/* For internal links in the editing mode */
.cm-s-obsidian .cm-hmd-internal-link,
.cm-s-obsidian span.cm-hmd-internal-link {
    font-weight: bold !important;
}

/* For internal links in the reading (preview) mode */
.markdown-preview-view .internal-link {
    font-weight: bold !important;
}

It appears bolded internal links:

  • display properly for reading view
  • display properly in editing view only when directly editing the internal link
  • but do not display properly when I click away from the internal link in the editor.

See attached image:

What theme are you using? Do you have any other custom CSS with !importants anywhere that could be causing issues?

Using the snippet I shared, this is what I’m seeing on my end using the default theme:

Live Preview | Reading view

Obsidian_2bkoPRGBTh

What theme are you using? Do you have any other custom CSS with !importants anywhere that could be causing issues?

Unfortunately even with all other custom CSS disabled on the default theme, and even on a fresh install of Obsidian 1.6.7 on a new computer; the problem still persists.

The problem persists regardless of the theme: I tried default theme, Blue Topaz, Border, Simple themes.

No luck with the latest version of Obsidian 1.7.4 either - same issue as described above - bold internal links in editing view disappear as soon as I click away from the internal link.

No other custom CSS on file. Default theme.

Was able to solve the bolded internal links after some troubleshooting with inspector view and help from LLMs.

.markdown-source-view.mod-cm6 .cm-hmd-internal-link .cm-underline {
	font-weight: 600 !important;
}

Thanks for the hints and guidance earlier.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.