Browse Source

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 10 years ago
parent
commit
2ea7bf4042
1 changed files with 7 additions and 1 deletions
  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."
   (let* ((org-lang (org-element-property :language 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