emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: org-html-use-unicode-chars breaks source code blocks
Date: Tue, 04 Aug 2015 19:35:40 +0200	[thread overview]
Message-ID: <871tfjq7mb.fsf@gmx.us> (raw)
In-Reply-To: loom.20150804T153529-191@post.gmane.org

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

Hi,

Vladimir Alexiev <vladimir.alexiev@ontotext.com> 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 <URL> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-html-Only-translate-entities-to-UTF-8.patch --]
[-- Type: text/x-diff, Size: 1940 bytes --]

From 535366ec1e1819c73bb038712a19f5e1be0a51b7 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
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 <vladimir.alexiev@ontotext.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99451>
---
 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))))
 
 \f
-- 
2.5.0


  reply	other threads:[~2015-08-04 17:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 13:40 org-html-use-unicode-chars breaks source code blocks Vladimir Alexiev
2015-08-04 17:35 ` Rasmus [this message]
2015-08-04 18:37   ` Nicolas Goaziou
2015-08-07  9:56     ` Rasmus
2015-08-07 10:37       ` Nicolas Goaziou
2015-08-07 10:57         ` Rasmus
2015-08-08 21:09           ` Andreas Leha
2015-08-09 19:32             ` Sebastien Vauban
2015-08-16 13:48             ` Bastien Guerry
2015-08-16 18:47               ` Brady Trainor
2015-08-17  8:01                 ` Nicolas Goaziou
2015-08-17  8:41                   ` Brady Trainor
2015-08-17 16:44                   ` Rasmus
2015-08-16 14:03           ` Bastien Guerry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871tfjq7mb.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).