Skip to content

fix: correct MIME types for SVG and JPEG inline display#20

Open
PranavGadge01 wants to merge 2 commits intomgubi:mainfrom
PranavGadge01:fix/mime-types-svg-jpeg
Open

fix: correct MIME types for SVG and JPEG inline display#20
PranavGadge01 wants to merge 2 commits intomgubi:mainfrom
PranavGadge01:fix/mime-types-svg-jpeg

Conversation

@PranavGadge01
Copy link
Copy Markdown

Problem

The tm_mimetypes priority list in TeXmacsJulia.jl contained
two incorrect MIME type strings:

  • "image/svg" — not a valid MIME type, should be "image/svg+xml"
  • "image/jpg" — not a valid MIME type, should be "image/jpeg"

Because showable(MIME("image/svg"), x) and showable(MIME("image/jpg"), x)
never match any object, SVG and JPEG outputs silently fell through to
text/plain, rendering as raw object descriptions instead of images.

Additionally, no display handler existed for SVG at all.

This can be verified in a plain Julia REPL:

using Plots
p = plot(sin, 0, 2π)

showable(MIME("image/jpg"), p)     # false ← was in list
showable(MIME("image/jpeg"), p)    # true  ← correct

showable(MIME("image/svg"), p)     # false ← was in list
showable(MIME("image/svg+xml"), p) # true  ← correct

Fix

  • Correct "image/svg""image/svg+xml" in tm_mimetypes
  • Correct "image/jpg""image/jpeg" in tm_mimetypes
  • Add missing display handler for MIME"image/svg+xml"

@PranavGadge01
Copy link
Copy Markdown
Author

@hammerfunctor could u please check...

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