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

Inline code blocks don't show in the markdown preview. #7236

Closed
mikayla-maki opened this issue Feb 1, 2024 · 0 comments · Fixed by #7277
Closed

Inline code blocks don't show in the markdown preview. #7236

mikayla-maki opened this issue Feb 1, 2024 · 0 comments · Fixed by #7277
Labels
good first issue Issue suitable for first-time contributors

Comments

@mikayla-maki
Copy link
Contributor

Currently there are three separate, partially implemented markdown renderers in the Zed codebase:

  • rich_text::RichText, used by the markdown renderer and chat messages, specialized to support @mentions and style code blocks, caching, doesn't support inline code regions (the `)
  • markdown_renderer::Render, used by the markdown renderer, supports blocks like lists, tables, and headlines, non-caching
  • language::markdown, used by the editor popovers, provides caching, supports inline code regions and lists.

These implementations have been developed organically and are specialized to their use cases. We should be intentional about what parts of this we unify and which we leave separate. But that said, it would be nice to:

  • Ensure that all normal markdown syntax is supported everywhere (inline-code blocks)
  • Support fancy markdown tables and such in the channel chat, because it's fun
  • Have all markdown parsing be cached by default

Regardless of how that effort turns out though, inline-code blocks not rendering in the markdown preview is a bug, and should be fixed.

Reproduction steps:

  1. Make a markdown file, add some text including an inline code block
  2. Open the markdown preview
  3. 💥 the inline code block is not rendered
@mikayla-maki mikayla-maki added the good first issue Issue suitable for first-time contributors label Feb 1, 2024
SomeoneToIgnore pushed a commit that referenced this issue Feb 2, 2024
Fixes #7236.

The reason why the code was not displayed correctly is due to missing
background color for the inline code block.

Previously to this PR:

<img width="1840" alt="SCR-20240202-mclv"
src="https://github.com/zed-industries/zed/assets/67913738/92f63e72-db86-4de9-bb42-40549679e159"
alt="Screenshot showing that inline code blocks are not highlighted in
Markdown preview">

After this PR:

<img width="1796" alt="SCR-20240202-mccs"
src="https://github.com/zed-industries/zed/assets/67913738/5cf039af-82d7-41b8-b461-f79dec5ddf6a"
alt="Screenshot showing that inline code blocks are now highlighted in
Markdown preview">



Release Notes:

- Fixed inline code block not shown in markdown preview
([#7236](#7236)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue suitable for first-time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant