Explorar o código

ox-html: Support for exporting inline source code to HTML

* lisp/ox-html.el (org-html-inline-src-block): support for exporting
inline source code to HTML.
Nicolas Berthier %!s(int64=11) %!d(string=hai) anos
pai
achega
2ea7bf4042
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      lisp/ox-html.el

+ 7 - 1
lisp/ox-html.el

@@ -2414,7 +2414,13 @@ CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information."
 contextual information."
   (let* ((org-lang (org-element-property :language inline-src-block))
   (let* ((org-lang (org-element-property :language inline-src-block))
 	 (code (org-element-property :value inline-src-block)))
 	 (code (org-element-property :value inline-src-block)))
-    (error "Cannot export inline src block")))
+    (let ((lang (org-element-property :language inline-src-block))
+	  (code (org-html-format-code inline-src-block info))
+	  (label (let ((lbl (org-element-property :name inline-src-block)))
+		   (if (not lbl) ""
+		       (format " id=\"%s\""
+			       (org-export-solidify-link-text lbl))))))
+      (format "<code class=\"src src-%s\"%s>%s</code>" lang label code))))
 
 
 ;;;; Inlinetask
 ;;;; Inlinetask