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(image): filter null magic blocks #158

Merged
merged 2 commits into from
May 4, 2021

Conversation

rafegoldberg
Copy link
Contributor

💬  Thread

🧰 Changes

In certain, very specific scenarios, empty magic image blocks would throw an error on parse:

  • Ignore + filter the img list for empty entries.
  • Add test case.

🧬 QA & Testing

@rafegoldberg rafegoldberg added the bug Something isn't working label May 4, 2021
@kellyjosephprice kellyjosephprice temporarily deployed to markdown-pr-158 May 4, 2021 15:54 Inactive
Copy link
Member

@domharrington domharrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff is significantly more readable with whitespace changes ignored: https://github.com/readmeio/markdown/pull/158/files?diff=unified&w=1

👍 lgtm, nice catch.

@rafegoldberg rafegoldberg temporarily deployed to markdown-pr-158 May 4, 2021 16:02 Inactive
const img = imgs[0];

if (!img.url) return eat(match);
if (!img || !img.url) return eat(match);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason I cracked UP at the fact that we have a function called eat

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hahahahahahahaha, missed this comment.

@rafegoldberg rafegoldberg merged commit 603e0b5 into next May 4, 2021
@rafegoldberg rafegoldberg deleted the fix/filter-missing-magic-image-blocks branch May 4, 2021 23:16
rafegoldberg pushed a commit that referenced this pull request May 4, 2021
## Version 6.27.1-next.1

### 🛠 Fixes & Updates

* **image:** filter null magic blocks ([#158](#158)) ([603e0b5](603e0b5))
* fix release (not all masters are mains) ([0f5a8e9](0f5a8e9))
* fix release branch ([345e44f](345e44f))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor Author

This PR was released!

🚀 Changes included in v6.27.1-next.1

rafegoldberg pushed a commit that referenced this pull request May 24, 2021
## Version 6.27.1

### 🛠 Fixes & Updates

* **image:** filter null magic blocks ([#158](#158)) ([603e0b5](603e0b5))
* fix release (not all masters are mains) ([0f5a8e9](0f5a8e9))
* fix release branch ([345e44f](345e44f))
* **tables:** fix tables overflowing divs and unaligned borders ([#160](#160)) ([aa5fc94](aa5fc94))
* trigger release ([b7349c2](b7349c2))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor Author

This PR was released!

🚀 Changes included in v6.27.1

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

Successfully merging this pull request may close these issues.

5 participants