How to format Heading 1 and Heading 2 like Obsidian Publish? [SOLVED]

I noticed that all my notes published to Obsidian Publish, when they have either a Heading 1 or Heading 2, they automatically add the underline.

I’ve been adding the line manually on my computer, but now that I want to publish the notes to Publish, I would like to have Obsidian formatting those 2 headings automatically, if possible, so whenever I’m working locally, I know how it will look like when I publish them.

Can this be done? I would guess that using Templater or snippets, but not sure how as I’m new to Obsidian.

image


EDIT: Following the tips on this reply, I was able to underline the heading text, which is already a good visual cue, but I was wondering if I could add the underline all across the page similar to when we use ---?

Solution:

.HyperMD-header-1,
.HyperMD-header-2 {
    border-bottom: 1px solid var(--background-modifier-border);
}

div.HyperMD-header.HyperMD-header-1.cm-line,
div.HyperMD-header.HyperMD-header-2.cm-line {
    padding-bottom: 0.5em;
}

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