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
ListItem should only exist inside of a ListSection so the Post model throws errors:
TypeError: Cannot set property post of #<ListItem> which has only a getter
at LinkedList.adoptItem [as _adoptItem] (/Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/models/post.js:41:23)
at LinkedList.adoptItem (/Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:34:14)
at LinkedList.insertBefore (/Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:71:12)
at LinkedList.append (/Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/linked-list.js:54:12)
at DOMParser.appendSection (/Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:149:23)
at /Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:133:23
at Array.forEach (<anonymous>)
at forEach (/Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/utils/array-utils.js:53:16)
at DOMParser.appendSections (/Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:132:36)
at /Users/aileen/code/migrate/node_modules/@tryghost/mobiledoc-kit/dist/commonjs/mobiledoc-kit/parsers/dom.js:116:15 }
I propose that the section parser should create a ListItem for unexpected children of a list element if it contains any text content, otherwise it should be ignored. PR for that incoming.
The text was updated successfully, but these errors were encountered:
closesbustle#714
- if the section parser hits a list item and it's current state is not a previous list item or a list section then open a new list section using using the LI's parent list type
- prevents `ListItem` sections being created outside of a `ListSection`
closesbustle#714
- if the section parser hits a list item and it's current state is not a previous list item or a list section then open a new list section using using the LI's parent list type
- prevents `ListItem` sections being created outside of a `ListSection`
We've run into this when using mobiledoc-kit to migrate html content to mobiledoc content. This (invalid but surprisingly prevalent) html:
Results in a sections array such as:
ListItem
should only exist inside of aListSection
so thePost
model throws errors:I propose that the section parser should create a
ListItem
for unexpected children of a list element if it contains any text content, otherwise it should be ignored. PR for that incoming.The text was updated successfully, but these errors were encountered: