Skip to content
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

Using single quotes in a label causes a parsing error #4

Closed
Fermain opened this issue Dec 17, 2024 · 2 comments
Closed

Using single quotes in a label causes a parsing error #4

Fermain opened this issue Dec 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Fermain
Copy link
Contributor

Fermain commented Dec 17, 2024

In situations where a ' single quote char is used within a field label, the parser fails.

I noticed this during testing as many of my test project labels are formed like "Author's Name".

Reproduction:

collections:
  - name: "example"
    label: "Example Case"
    folder: "src/content/examples"
    fields:
      - name: "valid_field"
        label: "plain string"
        widget: "hidden"
      - name: "invalid_field"
        label: "string containing ' quote"
        widget: "hidden"
Fermain added a commit to Fermain/astro-decap-collection that referenced this issue Dec 17, 2024
Fermain added a commit to Fermain/astro-decap-collection that referenced this issue Dec 17, 2024
@davidenke
Copy link
Owner

davidenke commented Dec 17, 2024

Yes, there's no escaping right now whatsoever. And maybe escaped double quotes and line breaks (multiline yaml strings) have to be taken into account as well.

But this might be part of the yaml parser used under the hood.
I'll have a look at it.

@davidenke davidenke added the bug Something isn't working label Dec 17, 2024
@davidenke
Copy link
Owner

Thank you again @Fermain, turns out that there were multiple occasions of that issue.
I aligned it for the enum and object transforms as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants