From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: org-html-use-unicode-chars breaks source code blocks Date: Tue, 04 Aug 2015 19:35:40 +0200 Message-ID: <871tfjq7mb.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMg84-00013k-4o for emacs-orgmode@gnu.org; Tue, 04 Aug 2015 13:36:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMg7y-0008Dp-Pu for emacs-orgmode@gnu.org; Tue, 04 Aug 2015 13:35:55 -0400 Received: from plane.gmane.org ([80.91.229.3]:34035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMg7y-0008DE-63 for emacs-orgmode@gnu.org; Tue, 04 Aug 2015 13:35:50 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZMg7w-0007Fo-3z for emacs-orgmode@gnu.org; Tue, 04 Aug 2015 19:35:48 +0200 Received: from ip5b4025d5.dynamic.kabel-deutschland.de ([91.64.37.213]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Aug 2015 19:35:48 +0200 Received: from rasmus by ip5b4025d5.dynamic.kabel-deutschland.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Aug 2015 19:35:48 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi, Vladimir Alexiev writes: > I've set org-html-use-unicode-chars since I want ox-html to leave IRIs as IRIs. > But this has another undesired effect: it breaks references in code, > since it doesn't escape the brackets. I think this should only apply to entities. Any reason to do it on the whole output? Nicolas? This patch makes that change. Rasmus -- This message is brought to you by the department of redundant departments --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-html-Only-translate-entities-to-UTF-8.patch >From 535366ec1e1819c73bb038712a19f5e1be0a51b7 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Tue, 4 Aug 2015 19:12:00 +0200 Subject: [PATCH 1/4] ox-html: Only translate entities to UTF-8 * ox-html.el (org-html-final-function): Do not check :html-use-unicode-chars. (org-html-entity): Check :html-use-unicode-chars (org-html-use-unicode-chars): Update docstring. Reported-by: Vladimir Alexiev --- lisp/ox-html.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 2c13bf6..c329b72 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -609,10 +609,10 @@ Warning: non-nil may break indentation of source code blocks." :type 'boolean) (defcustom org-html-use-unicode-chars nil - "Non-nil means to use unicode characters instead of HTML entities." + "Non-nil means to use unicode characters for org-entities instead of HTML codes." :group 'org-export-html - :version "24.4" - :package-version '(Org . "8.0") + :version "25.1" + :package-version '(Org . "8.3") :type 'boolean) ;;;; Drawers @@ -2359,7 +2359,9 @@ holding contextual information. See `org-export-data'." "Transcode an ENTITY object from Org to HTML. CONTENTS are the definition itself. INFO is a plist holding contextual information." - (org-element-property :html entity)) + (if (plist-get info :html-use-unicode-chars) + (org-element-property :utf-8 entity) + (org-element-property :html entity))) ;;;; Example Block @@ -3500,9 +3502,6 @@ contextual information." (set-auto-mode t) (if (plist-get info :html-indent) (indent-region (point-min) (point-max))) - (when (plist-get info :html-use-unicode-chars) - (require 'mm-url) - (mm-url-decode-entities)) (buffer-substring-no-properties (point-min) (point-max)))) -- 2.5.0 --=-=-=--