-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
text/html displayed too small #4
Comments
I can confirm this. The issue is that the In the meantime, you can make the priority of |
Actually I spoke too soon. It looks like some of the xml tags are being converted to all lowercase when sending the html to Note the (defun search-for-viewbox-raw-html ()
(let ((jupyter-inhibit-handlers t)
(jupyter-current-client
(with-current-buffer
(jupyter-repl-available-repl-buffers 'julia-mode 'first)
jupyter-current-client)))
(jupyter-with-message-data
(jupyter-wait-until-received :execute-result
(jupyter-send-execute-request jupyter-current-client
:code "plot(df, x=:SepalLength, y=:SepalWidth)"))
((html text/html))
(with-temp-buffer
(insert html)
(goto-char (point-min))
(let (case-fold-search) ; Ensure we care about case when searching
;; Should error since it should be viewBox
(re-search-forward "viewbox")
(message "viewbox found!")))))) (defun search-for-viewbox-svg-from-html ()
(let ((jupyter-inhibit-handlers t)
(jupyter-current-client
(with-current-buffer
(jupyter-repl-available-repl-buffers 'julia-mode 'first)
jupyter-current-client)))
(jupyter-with-message-data
(jupyter-wait-until-received :execute-result
(jupyter-send-execute-request jupyter-current-client
:code "plot(df, x=:SepalLength, y=:SepalWidth)"))
((html text/html))
(with-temp-buffer
(insert html)
(goto-char (point-min))
(let* ((svg-data)
(shr-put-image-function
(lambda (spec &rest _) (setq svg-data (car spec)))))
(shr-render-region (point-min) (point-max))
(erase-buffer)
(let (case-fold-search) ; Ensure we care about case when searching
(insert svg-data)
(goto-char (point-min))
;; Doesn't error here but it should be viewBox
(re-search-forward "viewbox")
(message "viewbox found!"))))))) |
@dzop on latest master, anything that returns something with mimetype "text/html" now doesn't display anything at all: Base.show(io, ::MIME"text/html", x::String) = print(io, "<p>$x<p>")
"hello" Debug:
|
I can confirm this. It is because the html doesn't have any html tags so Thanks, I will find a fix for this. I am not too familiar with xml/html so it might take some. |
OK I believe I have fixed this by parsing as XML if an XML prolog is given, i.e. if the Let me know if this is still an issue. |
Since
jupyter--debug
doesn't seem to log incoming requests (can't look at the metadata associated with svg myself), I haven't been able to get very far in debugging this myself. You're a julia user, so I'll give repro steps in terms of julia code (and an image to let you see what I'm talking about).The text was updated successfully, but these errors were encountered: