Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Cleaning up the internals #4

Closed
wooorm opened this issue Mar 9, 2019 · 0 comments
Closed

Cleaning up the internals #4

wooorm opened this issue Mar 9, 2019 · 0 comments
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have

Comments

@wooorm
Copy link
Member

wooorm commented Mar 9, 2019

As @jxnblk mentioned in in GH-3,

I'm unsure about the preferred way to replace the parent node, so any pointers there would be helpful

...I think we should do this part properly.

I have some thoughts, but would like some context for the existence of this plugin. Here’s my understanding of how it currently works.

  1. Find all images (or image references, soon)
  2. If the found node has a parent that is a paragraph, and if that paragraph has one child
  3. Assume that child is an image and swap that paragraph for the supposed image

So I’m guessing that step 2 is looking through ancestors, rather than just the last ancestor (the parent), for cases like *![img](#)*, where there’s a paragraph, with emphasis, with an image.
But step 3 contradicts this.

We can change step 2, or change step 3. But to figure out which one should be fixed, I need a better understanding of how this is used. Are there more examples of expected input/output?

@wooorm wooorm closed this as completed in 0e4aa2c Jun 18, 2019
@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface 🦋 type/enhancement This is great to have 🧑 semver/major This is a change labels Aug 14, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have
Development

No branches or pull requests

1 participant