emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: Scott Randby <srandby@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Another HTML Export Problem
Date: Wed, 16 Mar 2011 02:31:55 +0100	[thread overview]
Message-ID: <87lj0fu9ys.fsf@gnu.org> (raw)
In-Reply-To: <4D8006C4.3080809@gmail.com> (Scott Randby's message of "Tue, 15 Mar 2011 20:39:32 -0400")

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

Hi Scott,

Scott Randby <srandby@gmail.com> writes:

> Some links are not exporting properly with org release_7.5.52.g0dc16. It
> seems that any link that contains "&" does not export correctly. Take
> the four links given below.

Yes, problems again here -- thanks for reporting.

If you can, please test this patch.  I'm not applying it right now as 
I want to make sure to apply a safe and complete patch.

Best,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-html.el.patch --]
[-- Type: text/x-patch, Size: 2623 bytes --]

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 0abecac..c6f26b5 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -848,9 +848,9 @@ MAY-INLINE-P allows inlining it as an image."
 	       (message "image %s %s" thefile org-par-open)
 	       (org-export-html-format-image thefile org-par-open))
 	    (concat
-	       "@<a href=\"" thefile "\"" (if attr (concat " " attr)) ">"
+	       "<a href=\"" thefile "\"" (if attr (concat " " attr)) ">"
 	       (org-export-html-format-desc desc)
-	       "@</a>")))))
+	       "</a>")))))
 
 (defun org-html-handle-links (line opt-plist)
   "Return LINE with markup of Org mode links.
@@ -1530,9 +1530,6 @@ lang=\"%s\" xml:lang=\"%s\">
 				  "@</a> ")
 			  t t line)))))
 
-	  ;; Format the links
-	  (setq line (org-html-handle-links line opt-plist))
-
 	  (setq line (org-html-handle-time-stamps line))
 
 	  ;; replace "&" by "&amp;", "<" and ">" by "&lt;" and "&gt;"
@@ -1541,6 +1538,9 @@ lang=\"%s\" xml:lang=\"%s\">
 	  (or (string-match org-table-hline-regexp line)
 	      (setq line (org-html-expand line)))
 
+	  ;; Format the links
+	  (setq line (org-html-handle-links line opt-plist))
+
 	  ;; TODO items
 	  (if (and (string-match org-todo-line-regexp line)
 		   (match-beginning 2))
@@ -1829,7 +1829,7 @@ lang=\"%s\" xml:lang=\"%s\">
   "Create image tag with source and attributes."
   (save-match-data
     (if (string-match "^ltxpng/" src)
-	(format "@<img src=\"%s\" alt=\"%s\"/>"
+	(format "<img src=\"%s\" alt=\"%s\"/>"
                 src (org-find-text-property-in-string 'org-latex-src src))
       (let* ((caption (org-find-text-property-in-string 'org-caption src))
 	     (attr (org-find-text-property-in-string 'org-attributes src))
@@ -1837,20 +1837,20 @@ lang=\"%s\" xml:lang=\"%s\">
 	(setq caption (and caption (org-html-do-expand caption)))
 	(concat
 	(if caption
-	    (format "%s@<div %sclass=\"figure\">
-@<p>"
-		    (if org-par-open "@</p>\n" "")
+	    (format "%s<div %sclass=\"figure\">
+<p>"
+		    (if org-par-open "</p>\n" "")
 		    (if label (format "id=\"%s\" " (org-solidify-link-text label)) "")))
-	(format "@<img src=\"%s\"%s />"
+	(format "<img src=\"%s\"%s />"
 		src
 		(if (string-match "\\<alt=" (or attr ""))
 		    (concat " " attr )
 		  (concat " " attr " alt=\"" src "\"")))
 	(if caption
-	    (format "@</p>%s
-@</div>%s"
-		(concat "\n@<p>" caption "@</p>")
-		(if org-par-open "\n@<p>" ""))))))))
+	    (format "</p>%s
+</div>%s"
+		(concat "\n<p>" caption "</p>")
+		(if org-par-open "\n<p>" ""))))))))
 
 (defun org-export-html-get-bibliography ()
   "Find bibliography, cut it out and return it."

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


-- 
 Bastien

  reply	other threads:[~2011-03-16  1:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16  0:39 Another HTML Export Problem Scott Randby
2011-03-16  1:31 ` Bastien [this message]
2011-03-17  8:07   ` Bastien
2011-03-17 14:45     ` Scott Randby
  -- strict thread matches above, loose matches on Subject: below --
2011-03-16 11:51 David Maus
2011-03-17 14:34 ` Eric S Fraga
2011-03-20 11:21   ` David Maus
2011-03-21  1:46     ` Bernt Hansen
2011-03-21  5:46       ` David Maus
2011-03-21 12:49         ` Bernt Hansen

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=87lj0fu9ys.fsf@gnu.org \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=srandby@gmail.com \
    /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).