Bläddra i källkod

Fontify inline source blocks when exporting to HTML

* lisp/ox-html.el (org-html-inline-src-block): Fontify inline source
blocks.
Nicolas Berthier 8 år sedan
förälder
incheckning
2c9f6fcef9
1 ändrade filer med 8 tillägg och 6 borttagningar
  1. 8 6
      lisp/ox-html.el

+ 8 - 6
lisp/ox-html.el

@@ -2624,12 +2624,14 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
   "Transcode an INLINE-SRC-BLOCK element from Org to HTML.
 CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information."
-  (let ((lang (org-element-property :language inline-src-block))
-	(code (org-element-property :value inline-src-block))
-	(label
-	 (let ((lbl (and (org-element-property :name inline-src-block)
-			 (org-export-get-reference inline-src-block info))))
-	   (if (not lbl) "" (format " id=\"%s\"" lbl)))))
+  (let* ((lang (org-element-property :language inline-src-block))
+	 (code (org-html-fontify-code
+		(org-element-property :value inline-src-block)
+		lang))
+	 (label
+	  (let ((lbl (and (org-element-property :name inline-src-block)
+			  (org-export-get-reference inline-src-block info))))
+	    (if (not lbl) "" (format " id=\"%s\"" lbl)))))
     (format "<code class=\"src src-%s\"%s>%s</code>" lang label code)))
 
 ;;;; Inlinetask