You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, if I add something before my list, then it works as expected. So I have added 'This is a line of text' above the list in the portable content editor and now my SanityContent component returns the following:
<div><p>This is a line of text</p><ul><li>one</li><li>two</li><li>three</li></ul></div>
So it's only an issue when a bullet list is the first thing inside the portable content block.
The text was updated successfully, but these errors were encountered:
Version
module: 0.8.0
nuxt: 2.15.3
Nuxt configuration
mode:
Reproduction
The first bullet of my list is appearing as a
<li>
outside of my code using SanityContent component when it is the first thing inside the box.My sanity document field is:
{ name: 'test', type: 'array', of: [ {type: 'block'} ] },
My nuxt implementation is: (where c is my page content)
<SanityContent :blocks="c.test" />
In a basic test, where I have three bullet points, the blocks return the following JSON:
[ { "_key": "1c6db3700c85", "_type": "block", "children": [ { "_key": "2ceb3af83031", "_type": "span", "marks": [], "text": "one" } ], "level": 1, "listItem": "bullet", "markDefs": [], "style": "normal" }, { "_key": "2225fa05c5ca", "_type": "block", "children": [ { "_key": "5e58e5f761fe", "_type": "span", "marks": [], "text": "two" } ], "level": 1, "listItem": "bullet", "markDefs": [], "style": "normal" }, { "_key": "17c1b0f23100", "_type": "block", "children": [ { "_key": "60921bf5a711", "_type": "span", "marks": [], "text": "three" } ], "level": 1, "listItem": "bullet", "markDefs": [], "style": "normal" } ]
This outputs in the DOM as the following:
<div><li>one</li><ul><li>two</li><li>three</li></ul></div>
As you can see, the first item isn't in the
<ul>
as it should be. It should of returned:<div><ul><li>one</li><li>two</li><li>three</li></ul></div>
However, if I add something before my list, then it works as expected. So I have added 'This is a line of text' above the list in the portable content editor and now my SanityContent component returns the following:
<div><p>This is a line of text</p><ul><li>one</li><li>two</li><li>three</li></ul></div>
So it's only an issue when a bullet list is the first thing inside the portable content block.
The text was updated successfully, but these errors were encountered: