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

fixes #1395 #1430

Merged
merged 11 commits into from
Sep 28, 2024
Merged

fixes #1395 #1430

merged 11 commits into from
Sep 28, 2024

Conversation

huumn
Copy link
Member

@huumn huumn commented Sep 24, 2024

  • This refactors all plugins (gfm exempted) into a single rehype plugin
  • It prevents making embeds out of links that has text sibling
  • It prevents images/videos from inlining with its text siblings
  • Begins moving some custom element component logic into non-rerendering rehype custom elements
  • It collages adjacent images into a flex grid, whether
    • the images are all in the same p tag
    • the images are in independent p tags

The one failing of this improvement is that images/videos that aren't markeddown as images, ![](), won't collage. This can be fixed for proxied images by passing in imgproxyURLs to the plugin, but even without it seems like a fair trade.

QA: 6

TODO:

  • should probably check code blocks, headings, and lists to make sure they still work.
  • fix break of item/user hover popover
  • refactor embeds
  • refactor more of the component customization into the rehype plugin
  • refactor text component into less of a mess
  • refactor as much of the media-to-link component into the rehype plugin if possible
  • refactor all sn remark and rehype plugins into a single rehype plugin
    • each tree visit or visitParents or findAndReplace walks every node in the tree

@huumn
Copy link
Member Author

huumn commented Sep 24, 2024

The ideal solution to this might be less heavy handed and create rehype plugins for embeds/media instead of treating them all as a.

@huumn huumn mentioned this pull request Sep 28, 2024
@huumn
Copy link
Member Author

huumn commented Sep 28, 2024

I skipped the media-or-link refactor. The biggest mess of it all is the imgproxyURL handling. That should probably be moved to the server so it's typed and doesn't need to be unpacked in the view-related code.

@huumn huumn merged commit cc4bbf9 into master Sep 28, 2024
6 checks passed
@huumn huumn deleted the no-inline-images-with-text branch September 28, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant