strip trailing :
character on frontmatter key
This commit is contained in:
parent
d3bdf8a4ca
commit
f3a7c7f94b
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,10 @@ def parse_frontmatter_line(line: str) -> tuple[str, str]:
|
||||||
"""
|
"""
|
||||||
frontmatter = tuple(line.strip()[3:].split(": ", 1))
|
frontmatter = tuple(line.strip()[3:].split(": ", 1))
|
||||||
key = frontmatter[0]
|
key = frontmatter[0]
|
||||||
|
|
||||||
|
if key.strip().endswith(":"):
|
||||||
|
key = key[:-1]
|
||||||
|
|
||||||
if len(frontmatter) < 2:
|
if len(frontmatter) < 2:
|
||||||
val = ""
|
val = ""
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue