emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fontify inline source blocks when exporting to HTML
@ 2017-05-15 15:35 Nicolas Berthier
  2017-05-15 16:29 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Berthier @ 2017-05-15 15:35 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

Hi!

Inline source code blocks are not fontified by the HTML backend anymore
(I have a document with such code blocks that exported fine two years
ago, with Org 7 or 8 I think).

If that's the intended behavior, then I would like to know the proper
way to recover the old behavior; otherwise, let me suggest this small
patch to remedy that issue.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fontify-inline-source-blocks-when-exporting-to-HTML.patch --]
[-- Type: text/x-patch, Size: 952 bytes --]

From 4682af888ca3b86eb05c6d40169725cca17136e3 Mon Sep 17 00:00:00 2001
From: Nicolas Berthier <nberth@member.fsf.org>
Date: Mon, 15 May 2017 15:44:11 +0100
Subject: [PATCH] Fontify inline source blocks when exporting to HTML

* lisp/ox-html.el (org-html-inline-src-block): Fontify inline source
blocks.
---
 lisp/ox-html.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index fc91e96..fef79ca 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2685,7 +2685,8 @@ contextual information."
 	 (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)))
+    (format "<code class=\"src src-%s\"%s>%s</code>" lang label
+	    (org-html-fontify-code code lang))))
 
 ;;;; Inlinetask
 
-- 
2.7.0.rc0.20.g4b9ab0e


[-- Attachment #3: Type: text/plain, Size: 92 bytes --]


Best regards,
-- 
Nicolas Berthier                                        FSF Member #7975

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fontify inline source blocks when exporting to HTML
  2017-05-15 15:35 [PATCH] Fontify inline source blocks when exporting to HTML Nicolas Berthier
@ 2017-05-15 16:29 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-05-15 16:29 UTC (permalink / raw)
  To: Nicolas Berthier; +Cc: emacs-orgmode

Hello,

Nicolas Berthier <nberth@member.fsf.org> writes:

> Inline source code blocks are not fontified by the HTML backend anymore
> (I have a document with such code blocks that exported fine two years
> ago, with Org 7 or 8 I think).

After a quick investigation, it happens I "fixed" this in
b7c144a104641c2680ec8bd1f3092698fcca038c.


> * lisp/ox-html.el (org-html-inline-src-block): Fontify inline source
> blocks.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-15 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-15 15:35 [PATCH] Fontify inline source blocks when exporting to HTML Nicolas Berthier
2017-05-15 16:29 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).