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

MarkDefs sometimes missing in block content #7797

Open
heggemsnes opened this issue Nov 12, 2024 · 0 comments
Open

MarkDefs sometimes missing in block content #7797

heggemsnes opened this issue Nov 12, 2024 · 0 comments

Comments

@heggemsnes
Copy link

Describe the bug

I haven't been directly able to reproduce it, but our editors sometimes are able to create block content like this:

Excerpt from entire content:

"content": [
    {
      "_key": "8443f579db40",
      "_type": "block",
      "children": [
        {
          "_key": "455a4ebd387e",
          "_type": "span",
          "text": "For at et tiltak skal virke som tenkt, så må man følge opp og være tro mot den anbefalte måten å jobbe på. Å etterleve anbefalt arbeidsmåte er altså en forutsetning for å oppnå best mulig effekt av tiltak."
        }
      ],
      "style": "normal"
    },
    {
      "_key": "b6b2382edd59",
      "_type": "block",
      "children": [
        {
          "_key": "04c4e6416c7b",
          "_type": "span",
          "text": "Fagfolk kaller dette for «implementeringskvalitet», noe som det slett ikke er lett å få til å vare over lang tid i skolen."
        }
      ],
      "style": "normal"
    },
  ],

Where the markDefs are not set. This causes issues in the portableText render as the @portabletext/react expects there to be an array where it is now undefined or null.

To Reproduce

This is the problem, I can't reproduce it... Will check more with the editing flow of our editors.

Expected behavior

Empty array of markDefs should be set.

Which versions of Sanity are you using?
3.63.0

What operating system are you using?

MacOS

Which versions of Node.js / npm are you running?

10.2.4
v20.11.0

Additional context

I'm currently handling it in my frontend by just adding an empty array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant