-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use quoted values with colon in metadata #511
Comments
I've solved this by manually parsing with jsyaml and calling |
I will have to look into this carefully, since the metadata module is a very simplified version of yml. |
I confirm this issue and would like to get it fixed as well. |
same |
any updates? |
It looks like the regex used to parse metadata is greedily matching to the last colon when a non-greedy match should be used instead:
/^([\S ]+): +([\s\S]+?)$/gm.exec('title: Lorem: ipsum') produces: [
'title: Lorem: ipsum',
'title: Lorem',
'ipsum',
...
] Whereas /^([\S ]+?): +([\s\S]+?)$/gm.exec('title: Lorem: ipsum')
// ^ produces: [
'title: Lorem: ipsum',
'title',
'Lorem: ipsum',
...
] |
I want to wrap a value in my metadata with quotes so it can contain a colon, e.g.
However this is not parsed correctly, what I get back from a call to
getMetadata()
is quite bizarreTrying to use HTML entities
:
in place of the colon only makes things worseThe text was updated successfully, but these errors were encountered: