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

SVG inline image broken #49

Closed
TobiasZawada opened this issue Apr 22, 2024 · 0 comments
Closed

SVG inline image broken #49

TobiasZawada opened this issue Apr 22, 2024 · 0 comments

Comments

@TobiasZawada
Copy link

TobiasZawada commented Apr 22, 2024

The following lisp-code creates a buffer *test* with an embedded svg image data.

The image is broken in the HTML file generated by htmlize-buffer in buffer *test*.

The reason is that the data is exported with Mime type svg instead of svg+xml.

(with-current-buffer (get-buffer-create "*test*")
  (let (b e)
    (erase-buffer)
    (insert "\t  Text before\n\t")
    (setq b (point))
    (insert (propertize "bold\n" 'face 'bold)
	    (propertize "\t  italic\n" 'face 'italic))
    (setq e (point))
    (insert "\n\tText after")
    (let ((ol (make-overlay b e)))
      (overlay-put
       ol
       'display
       (create-image
	"<svg height=\"140\" width=\"500\" xmlns=\"http://www.w3.org/2000/svg\">
<ellipse rx=\"100\" ry=\"50\" cx=\"120\" cy=\"80\"
style=\"fill:yellow;stroke:green;stroke-width:3\" />
</svg>"
	'svg
	t)))))
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

No branches or pull requests

1 participant