Repository navigation
Conversation
Preview HTTPS Markdown images in the Docs reader, editor and revision history. Keep their source available for editing and use the existing media transport for relay-hosted images. Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category: improvement
User Impact: People can see images alongside the text they’re reading or editing in Buzz Docs.
Problem
Markdown images in Docs appear as alt text in the reader and as Markdown syntax in formatted Editing. People have to open the image separately to see it in context.
Solution
Render HTTPS Markdown images inline in Viewing, formatted Editing, and revision previews. Keep the image syntax available in Markdown source and use the session’s existing media handling for relay-hosted images.
File changes
docs/buzz-help.md
Explains where Docs displays images and where to edit their Markdown.
src/bundled/docs/DocDialogs.tsx
Enables images in revision previews.
src/bundled/docs/DocDocument.tsx
Passes the connected relay session to the editor for saved Docs.
src/bundled/docs/DocDocument.test.tsx
Covers linked images, reference images, relay media resolution, and URL filtering in Docs.
src/bundled/docs/DocEditor.tsx
Enables image previews in the formatted Docs editor.
src/bundled/docs/DocMarkdown.tsx
Enables images when viewing a Doc.
src/bundled/docs/NewDocDocument.tsx
Passes the connected relay session to the editor for new Docs.
src/features/markdown/Markdown.module.css
Scales inline images to fit the available width and preserves their aspect ratios.
src/features/markdown/MarkdownDocument.tsx
Adds opt-in HTTPS image rendering and an alt-text fallback. External image requests omit the referrer.
src/features/messages/DocumentEditor.tsx
Carries the image option through the editor’s formatted and source modes.
src/features/messages/DocumentEditor.test.tsx
Covers typing, copying, and pasting images while preserving their source.
src/features/messages/EditableInput.tsx
Shows document image previews and integrates them with typing and paste.
src/features/messages/PluginMarkdown.tsx
Exposes opt-in image rendering to document surfaces using the plugin UI API.
src/features/messages/composer-clipboard.ts
Preserves the image Markdown when copying and restores inline previews when pasting into an enabled document.
src/features/messages/composer-document.ts
Adds an inline image node that retains its original Markdown as the editor’s source.
src/features/messages/document-editor-markdown.ts
Recognizes Markdown images and resolves references for formatted previews.
src/features/messages/label-text.ts
Uses the image’s alt text when it provides a link label.
Try it
with the URL of a reachable HTTPS image.Validation
Screenshots and walkthrough
Viewing
Formatted Editing
docs-markdown-images.mp4