How to include punctuation marks into YAML frontmatter?

What I’m trying to do

I created a quote template and trying to include its text into frontmatter.
I noticed that if the quote contains “:” it would break the code and not display it later, even if it is enclosed in double quotes.

quote-text: "John says*:* this is right." 
  • will break it.
quote-text: "John says, this is right" 

… will later allow me to display this text with inline code like this:

= this.quote-text 

Any way to escape it and still insert punctuations like this into the quote when it is in frontmatter?

If the quote has multiple paragraphs, it breaks too. Again, wish I knew how to include quotes that have multiple characters!

Thank you so much!!

And I repeat my question, how is it broken?

Using straight double quotes should escape most characters if not all, making it a legal property. Using other quotes is another matter, but
even though your forum post doesn’t escape them properly I can see (if I quote your text) that you’re using the correct quotes.

It would also be useful to see which version of Obsidian and Dataview you’re using, as that could also possibly give us some hints.

Where is this repeated from? Do we need to merge threads?

@AlDrm , when you post code examples please mark them as code (the same way you would in Obsidian) so readers can see it properly. Thanks! (I edited your post to do it here.)

1 Like
1 Like

Don’t think so, as the other thread was more on getting the other parts of it working. It was just left in kind of unfinished state, with open questions without answers. So I think it’s just fine as it stands now, if only we get some answers so we can move forward. :smiley:


Thank you for clarifying it!

  1. How can I verify that I am using the right quotation marks? I copy those quotes, quotation marks come with it automatically and they do look fancier than my regular ones on a desktop, but I can’t tell the difference on a phone… Tried retyping it, still doesn’t show the quote when there is “:” inside a text.

  2. Obsidian Version: 1.5.3 (Installer 1.4. 16); Dataview: 0.5.64 (BTW, any way to set it to update automatically?!)

  3. How it breaks? It just doesn’t show anything instead of the “this.quote-text”. Here is an example how it looks when it works:

Here is an example when it doesn’t work:
does not work

Thank you so much!!!

Thank you!! That was my thinking too. I didn’t get an answer how to fix it, but was able to narrow it down because I’ve seen it happen in other pieces of code I was trying to get to work. Easier to explain on this example… and I’d love to learn how to enclose those characters correctly to keep codes from breaking.

If you believe I should just have continued that thread - deeply deeply sorry and would address it differently next time I have a question!!!

If they’re not straight quotes, they wont work. So they need to be like this: ". Neither of these would work: ”“„«». In a forum post like this, you can escape most of these by having a line in front and after with four backticks, i.e. ````. That’ll escape both ordinary text, and even codeblocks if you choose to have some of those in your text.

Obsidian can be set to update automatically from Settings > General > Automatic updates, but every now and then you need to do a full re-install (which wont hurt your vaults) to update the installer version (the 1.4.16 in your case)). So that you should seriously consider doing.

For plugins, there is no auto-updating, so you need to go to Settings > Community plugins, and do Check for updates, and potentially Update all (or choose which to update).

Regarding your versions, it shouldn’t matter, but then again something strange is happening at your end. The Dataview is the latest version, though.

Could you show the entire version of the one which do break? That is the source text, not an image of it? And do remember to put in between lines with four backticks.

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