selimrbd / py-obsidianmd

Python interface to your Obsidian notes
BSD 3-Clause "New" or "Revised" License
262 stars 21 forks source link

pyomd removes underscores from front matter #20

Open acepelon opened 1 year ago

acepelon commented 1 year ago

Might be related to the other new bug, but if I run pyomd to move front matter similar to:

---
date: 2023_0129 
---

to dataview inline, the date shows up in the dataview inline as: date:: 20230129 meaning, it removed the underscore (which I need).

I have this naming convention for dates in pretty much every one of my files, sadly. Hopefully this is an easy fix?

Thanks! ACE

full syntax:

from pyomd import Notes
from pyomd import Note
from pyomd.metadata import MetadataType
from pathlib import Path
path = Path('/Users/acepelon/git/example-vault/media/test.md')
notes = Notes(path) 
notes.metadata.move(fr=MetadataType.FRONTMATTER, to=MetadataType.INLINE)
print (notes.notes)
notes.update_content(inline_inplace=False, inline_position="top",inline_tml="callout")
notes.write()