Support em-dash, en-dash, etc. in inlined SVG captions

master
Kaushal Modi 7 years ago
parent 527e53df50
commit 6731776300
  1. 9
      ox-hugo.el
  2. 2
      test/site/content-org/all-posts.org
  3. 2
      test/site/content/posts/inlined-svg.md

@ -2052,8 +2052,7 @@ and rewrite link paths to make blogging more seamless."
useful-parent info
nil #'org-html--has-caption-p))
" " ;" </span>"
;; Escape the double-quotes, if any,
;; present in the caption.
;; Escape the double-quotes, if any.
(replace-regexp-in-string "\"" "\\\\\"" caption))))
(extension (downcase (file-name-extension raw-path)))
(inlined-svg (and (stringp extension)
@ -2077,13 +2076,11 @@ and rewrite link paths to make blogging more seamless."
svg-contents)))
(caption-html (if (not caption)
""
;; (caption-str
;; (org-html-convert-special-strings ;Interpret em-dash, en-dash, etc.
;; (org-export-data-with-backend caption 'html info)))
(format (concat "\n\n<div class=\"figure-caption\">\n"
" %s\n"
"</div>")
caption))))
(org-html-convert-special-strings ;Interpret em-dash, en-dash, etc.
(org-export-data-with-backend caption 'html info))))))
;; (message "[ox-hugo-link DBG] svg contents: %s" svg-contents)
;; (message "[ox-hugo-link DBG] svg contents sanitized: %s" svg-contents-sanitized)
(concat svg-contents-sanitized caption-html))

@ -364,7 +364,7 @@ start
:[[https://ox-hugo.scripter.co/ ox-hugo homepage]];
stop
#+end_src
#+caption: An SVG with hyperlinks generated using PlantUML
#+caption: An SVG with *hyperlinks* -- generated using PlantUML
#+attr_html: :inlined t
#+RESULTS:
[[file:svg-with-hyperlinks.svg]]

@ -51,5 +51,5 @@ points="76.5,93.9688,80.5,103.9688,84.5,93.9688,80.5,97.9688"
style="stroke: #A80036; stroke-width: 1.0;"/></g></svg>
<div class="figure-caption">
Figure 1: An SVG with hyperlinks generated using PlantUML
Figure 1: An SVG with **hyperlinks** &#x2013; generated using PlantUML
</div>

Loading…
Cancel
Save