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

Fix 'Invalid type' on empty list item #3

Closed
wants to merge 1 commit into from

Conversation

ohtake
Copy link
Contributor

@ohtake ohtake commented Oct 14, 2016

If mdast has an empty children, strip-markdown raises Invalid type: undefined.
The minimum example is - (hyphen and space).

// Some attributes are removed for simplicity
{ type: 'root',
  children:
   [ { type: 'list',
       children:
        [ { type: 'listItem',
            children: [] } ], }, ], }
Error: Invalid type: undefined
 at one (node_modules\strip-markdown\index.js:39:11)
 at Array.map (native)
 at all (node_modules\strip-markdown\index.js:66:36)
 at one (node_modules\strip-markdown\index.js:48:23)

@wooorm wooorm closed this in c1d9161 Oct 14, 2016
@wooorm
Copy link
Member

wooorm commented Oct 14, 2016

Thanks again, @ohtake :)

@ohtake ohtake deleted the empty-listitem branch October 14, 2016 08:48
@wooorm wooorm added ⛵️ status/released 🐛 type/bug This is a problem 👶 semver/patch This is a backwards-compatible fix 🗄 area/interface This affects the public interface labels Aug 15, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem
Development

Successfully merging this pull request may close these issues.

2 participants