obsidian-ReadItLater icon indicating copy to clipboard operation
obsidian-ReadItLater copied to clipboard

Remove illegal chars from properties

Open Nitero opened this issue 1 year ago • 1 comments

Please check that this issue hasn't been reported before.

  • [X] I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

Inserting a youtube title as string into a property should work

Current behaviour

When saving a youtube video where the title includes illegal characters like " and writing this title to a property like below will result in a YAML error which breaks the properties. This can be prevented by not putting the title in quotes, but I think this is suboptimal because then it is is not clear that this property should be treated as a string.

image

Steps to reproduce

Have this as your youtube template and try to save this video.

---
titleAsString: "%videoTitle%"
titleNoString: %videoTitle%
---

Which Operating Systems are you using?

  • [ ] Android
  • [ ] iPhone/iPad
  • [ ] Linux
  • [ ] macOS
  • [X] Windows

Obsidian Version

1.6.3

Plugin Version

0.4.0

Checks

  • [ ] I have tried it with all other plugins disabled and the error still occurs

Possible solution

It seems to work for the file name so maybe just reuse that logic for all properties? Or are there different illegal characters for YAML than for the file name?

Nitero avatar Jun 20 '24 17:06 Nitero

+++

Medullitus avatar Sep 03 '24 07:09 Medullitus

Please update to the newest version with the new template engine. Then you can use this syntax to replace quotes in the Youtube video title.

---
titleAsString: "{{ videoTitle|replace('"') }}"
---

adamluckdev avatar Nov 22 '24 20:11 adamluckdev

Please update to the newest version with the new template engine. Then you can use this syntax to replace quotes in the Youtube video title.

---
titleAsString: "{{ videoTitle|replace('"') }}"
---

Hello. Thank you for your response. Could you explain how we can apply the syntax you shared?

Medullitus avatar Nov 26 '24 01:11 Medullitus

Please update to the newest version with the new template engine. Then you can use this syntax to replace quotes in the Youtube video title.

---
titleAsString: "{{ videoTitle|replace('"') }}"
---

Hello. Thank you for your response. Could you explain how we can apply the syntax you shared?

Hi, just add it to the selected template in plugin settings. If you have problem with the syntax, please open new issue.

adamluckdev avatar Nov 26 '24 05:11 adamluckdev