emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas Morgan <tlm@ziiuu.com>
To: emacs-orgmode@gnu.org
Subject: Bug: unconverted dashes in HTML export
Date: Sat, 01 Feb 2014 17:29:17 -0500	[thread overview]
Message-ID: <87d2iykpwo.fsf@azha.ziiuu.com> (raw)

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

Dear Org mode hackers,

I started Emacs with `emacs -Q -l setup.el test-case.org', then typed
`C-c C-e h o' to export to HTML and open the result.  The setup file
(`setup.el'), test case (`test-case.org'), HTML output (`lose.html'),
and a PDF printed by the web browser (`lose.pdf'), are attached.

The test case contains a one-cell table with three hyphens (`---').
I expected this to be converted to an em-dash in the HTML output,
but it remained three hyphens.

A patch fixing the problem is attached, along with the HTML and PDF
produced after the patch was applied (`win.html', `win.pdf').

I started preparing this report last May (sorry for the delay)
but just confirmed the bug again with Org-mode version 8.2.5g
(`release_8.2.5g-663-g24a213' @ `/src/org-mode/lisp/') and GNU Emacs
24.3.1 (`x86_64-unknown-linux-gnu', X toolkit, Xaw3d scroll bars)
of 2013-09-24.

Thanks and best regards,
Thomas


[-- Attachment #2: setup.el --]
[-- Type: application/emacs-lisp, Size: 47 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: test-case.org --]
[-- Type: text/x-org, Size: 61 bytes --]

#+TITLE: Bug with unconverted dashes in HTML export

| --- |

[-- Attachment #4: lose.html --]
[-- Type: text/html, Size: 5341 bytes --]

[-- Attachment #5: lose.pdf --]
[-- Type: application/pdf, Size: 15268 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0001-Convert-dashes-in-HTML-export-even-when-at-end-of-st.patch --]
[-- Type: text/x-diff, Size: 926 bytes --]

From bd14cdce80a610a5eadbf563ac12472fbed542a5 Mon Sep 17 00:00:00 2001
From: Thomas Morgan <tlm@ziiuu.com>
Date: Mon, 13 May 2013 11:06:52 +0200
Subject: [PATCH] Convert dashes in HTML export even when at end of string.

* lisp/ox-html.el (org-html-special-string-regexps): Convert dashes
  even when at end of string.
---
 lisp/ox-html.el |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 54c6a45..f47e760 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -145,8 +145,8 @@
 
 (defconst org-html-special-string-regexps
   '(("\\\\-" . "&#x00ad;")		; shy
-    ("---\\([^-]\\)" . "&#x2014;\\1")	; mdash
-    ("--\\([^-]\\)" . "&#x2013;\\1")	; ndash
+    ("---\\([^-]?\\)" . "&#x2014;\\1")	; mdash
+    ("--\\([^-]?\\)" . "&#x2013;\\1")	; ndash
     ("\\.\\.\\." . "&#x2026;"))		; hellip
   "Regular expressions for special string conversion.")
 
-- 
1.7.9.5


[-- Attachment #7: win.html --]
[-- Type: text/html, Size: 5346 bytes --]

[-- Attachment #8: win.pdf --]
[-- Type: application/pdf, Size: 15316 bytes --]

             reply	other threads:[~2014-02-08  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-01 22:29 Thomas Morgan [this message]
2014-02-08  9:29 ` Bug: unconverted dashes in HTML export Nicolas Goaziou
2014-02-10  9:33   ` Thomas Morgan

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=87d2iykpwo.fsf@azha.ziiuu.com \
    --to=tlm@ziiuu.com \
    --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).