fix plantuml server url encode

This commit is contained in:
Aaron Ji 2023-05-09 14:28:58 +08:00
parent ea45a13707
commit 88ec2b989b
No known key found for this signature in database
GPG Key ID: FC6BDB92CD5BEB22
1 changed files with 3 additions and 2 deletions

View File

@ -426,8 +426,9 @@ Put the result into buffer BUF. Window is selected according to PREFIX:
"Encode the string STRING into a URL suitable for PlantUML server interactions."
(let* ((coding-system (or buffer-file-coding-system
"utf8"))
(encoded-string (base64-encode-string (encode-coding-string string coding-system) t)))
(concat plantuml-server-url "/" plantuml-output-type "/-base64-" encoded-string)))
(str (encode-coding-string string coding-system))
(encoded-string (mapconcat (lambda(x)(format "%02X" x)) str ) ))
(concat plantuml-server-url "/" plantuml-output-type "/~h" encoded-string)))
(defun plantuml-server-preview-string (prefix string buf)
"Preview the diagram from STRING as rendered by the PlantUML server.