How do I stop --- (triple dashing) from forming a horizontal line

What I’m trying to do

I am currently trying to insert some meta data and hide it using YAML frontmatter syntax by inserting:

— (triple dashing/minus-ing)
Content
— (triple dashing/minus-ing)

Doing this will hide the word ‘content’ with the help of dataview. However, I am currently having trouble using the 3 dashes because everytime I type out three dashes, it forms a horizontal line which denies me from using the metadata/frontmatter.

Things I have tried

I have tried using \ and `` before typing in the 3 dashes but using those will block/deny my frontmatter from working. I’ve also seen a similar topic where he said his solution was messing around with Obsidian themes and restarting Obsidian. I have tried to mess with themes and restart Obsidian + the dataview plugin, but no luck. Does anyone have any solutions to my problem?

Properties needs to be defined at the very top of the file, and then the triple dash shouldn’t be converted into horizontal lines. If you’re not on the top of the file, triple dashes are supposed to be horizontal lines.

So try removing any whitespace or stuff in front of the triple dash and it should be interpreted as the start of the properties section.

1 Like

Can you show an actual full example? I’m not understanding where dataview comes into this. It might help if you show a full in-context example.

You can show code by using triple backticks:

```
---
your Markdown here
---
```
1 Like

Just a guess… make sure you are in source mode, not live preview.

I’m trying to input some data onto a table and hide it using the 3 dashes. Here is an example of what I’m trying to do:

but since my 3 dashes aren’t working, this is what’s happening to my table and note.

Nothing is showing up on my table. On the table it should say 1 under year and semester. I’ve tried using triple backticks to show code, but if I do that, it won’t register on my table. Moreover, using any sort of symbol such as backslash or spaces will affect the input for the table. Got any suggestions?

Which version of Obsidian are you using? I don’t recognise the glasses icon in your images…

And you are sure there is no whitespace characters before your first line of griple dashes?

The first image is an example I took off of Youtube. However, the version I am currently using is v1.6.7
I have also created a brand new note page and at the very top of the note page, I type in the 3 dashes, but it still forms a horizontal line.

Still thinking you already have frontmatter and try to add another yaml block in preview mode. Please verify that your editor is in source mode, not in live preview. You can toggle this via command palette. Even better change Editor mode to source mode permanently if you wanna edit your frontmatter in editor.

1 Like

I learned that if you want to insert YAML even using an Obsidian template or Templater, you have to be sure the editor is in Source mode when the template runs, or it will be inserted in the note body. You can work around this by inserting javascript into a Templater template, but it took me a lot of searching and experimenting before I figured out how to do that.

@BC0803 If you’re in the desktop version of Obsidian, click on the ... menu at the top of the editing window, then select “Source Mode”. You may want to go to Settings->Editor->Properties in Document and set it to Visible. This will always show the raw text of your YAML frontmatter, regardless of whether the editor is in Source mode. The nicely formatted version of the frontmatter can be viewed by clicking on the i icon in the right side panel.

What several people suspect is that your document has YAML that is hidden by settings, which then causes any other occurrences of --- to be treated as horizontal rules. YAML must be the very first thing in the file.

2 Likes

Thank you so much. It turns out I had my properties hidden so when I turned on source mode, nothing showed up. I was so confused because my 3 dashes were at the very top of the page, but it turns out the properties were hidden and have 3 dashes already so when I insert 3 dashes again, it won’t work. Thank you again for your great explanation.

1 Like

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