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

Markdown preview: add svg text support #21319

Open
1 task done
Tracked by #5346
Angelk90 opened this issue Nov 29, 2024 · 6 comments
Open
1 task done
Tracked by #5346

Markdown preview: add svg text support #21319

Angelk90 opened this issue Nov 29, 2024 · 6 comments
Labels
enhancement [core label] gpui GPUI rendering framework support markdown renderer

Comments

@Angelk90
Copy link
Contributor

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

As you can see from the images on zed when you preview a markdown but it contains an svg image that contains text, the text is not displayed on the svg.

Online:
Screenshot 2024-11-29 alle 09 53 27

Zed:
Screenshot 2024-11-29 alle 09 53 49

Svg of reference:
https://github.com/zed-industries/zed/actions/workflows/ci.yml/badge.svg

Environment

Zed: v0.164.0 (Zed Preview)
OS: macOS 14.1.1
Memory: 16 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

@Angelk90 Angelk90 added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Nov 29, 2024
@jansol jansol added gpui GPUI rendering framework support markdown renderer and removed triage Maintainer needs to classify the issue labels Nov 29, 2024
@jansol
Copy link
Contributor

jansol commented Nov 29, 2024

Specifically this seems to be a problem with the <text> element in SVG. I'd expect that if one were to open the file in inkscape, convert the text to paths and save the file, it would render fine.

@Angelk90

This comment was marked as off-topic.

@jansol

This comment was marked as off-topic.

@Angelk90

This comment was marked as off-topic.

@jansol

This comment was marked as off-topic.

@notpeter notpeter removed the admin read Pending admin review label Dec 2, 2024
@notpeter notpeter changed the title Markdown preview problem with svg containing text Markdown preview: add svg text support Dec 16, 2024
@notpeter notpeter added enhancement [core label] and removed bug [core label] labels Dec 16, 2024
@notpeter
Copy link
Member

Steps to reproduce:

  1. Create an file.svg with text:
<svg xmlns="http://www.w3.org/2000/svg" width="83" height="20">
    <path
        d="M0,3 C0,1.34 1.35,0 3.0,0 L40,0 L40,20 L3.0,20 C1.35,20 0,18.65 0,17 L0,3 Z"
    />
    <text fill="#00FF00"><tspan x="0" y="14">GR</tspan></text>
    <text fill="#FF0000"><tspan x="20" y="14">RE</tspan></text>
</svg>
  1. Create a file.md with markdown:
# hi

![file.svg](file.svg)
  1. zed file.md
  2. cmd-k, v (open markdown preview to the side)
Screenshot 2024-12-16 at 2 12 00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] gpui GPUI rendering framework support markdown renderer
Projects
None yet
Development

No branches or pull requests

3 participants