Stop - - - turning into horizontal line

Things I have tried

I have tried to de-activate all plugins and editor settings with no luck.

I have done the same thing on a new vault and it is fine so thinking there is a setting somewhere that is set within the vault.

What I’m trying to do

I want to be able to insert some meta data to be able to run queries via dataview. Every time I enter the — separate the line turns into the horizontal line.

Despite my best efforts I’m unable to find where this has been set.

Any suggestions where I may find this setting?

1 Like

Frontmatter needs to be the very first thing in a file.

If there is anything before the--- it will turn into a horizontal line and not be valid frontmatter.

Can you be more specific with what you are trying to do with your metadata? Why do you need three dashed lines to not turn into a horizontal line?
This behavior does not invalidate the metadata it encloses in frontmatter YAML, it’s a built-in feature and I don’t think you can turn it off, nor would you want to.

The --- substitution always happens when three dashes are alone on a line.
To avoid it, you could put a space before it, or a character after it.
But this breaks your frontmatter.

This is part of Markdown, so any markdown editor will turn “—” into a horizontal line. You can use backticks to have Markdown treat it like source code and not convert to a horizontal line. This page is a good resource for markdown syntax.

How about putting a leading \ as in

\---

?

If joethei’s answer doesn’t solve it for you, please post the actual Markdown from your note, so we can try and spot any potential syntax problems.

Put it between triple backticks ``` so it renders as pure Markdown.

1 Like

Thanks for the responses. I had a bit more of a play and I think the markdown was being a bit unpredictable which is what was becoming confusing.

When I was starting a note and entering the three dashes it kept creating the horizontal line which would then break the meta-data.

Example of what I was after:
image

How it shows in reading mode:

This is what it looks like in edit mode without the dashes:
image

And then in reading mode it turns into this rather than the meta summary:
image

I’ve restarted the app played around with some themes and it seems to be working again. Previously even if I entered the dashes on the first line it was still creating the horizontal line which was becoming annoying.

Looks like it was just something playing up in the end, will keep an eye on it.

Thanks for the assistance :slight_smile:

Glad you figured it out!
Yes, until you have typed both the beginning and ending lines of dashes for your metadata the editor might be confused. After you have typed both lines (with the first one being the first thing in your file), I would hope it would be un-confused!

1 Like

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