emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: [PATCH: RESUBMITTED] Fix broken CUSTOM_ID links
Date: Wed, 17 Nov 2010 20:52:51 +0530	[thread overview]
Message-ID: <814obgnf07.fsf@gmail.com> (raw)
In-Reply-To: <69E5CC30-46A0-47E2-A8F7-0B36BB8B29F4@gmail.com> (Carsten Dominik's message of "Wed, 17 Nov 2010 14:26:08 +0100")

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


>> this looks good,  However, I would like you to make a change to the
>> patch more more clarity.
>> Could you please write
>>   (or preferred target)
>> instead of
>>   remove
>> as the ID to be inserted?  Even though these are the same, the first
>> version is a lot clearer.
>> With this change, I will accept the patch.

My bad ... Ignore my previous mail. I accidentally attached the older
version that was lurking in my work area. 

Here is the newer version.

I have made the modifications requested by you. Reproducing the original
report for the sake of record.

Jambunathan K.

# Bug Description: Note the 'H:1' option. Search for 'broken' in the
# the below org file.

#+OPTIONS:   H:1

* Links
** Targets
*** Fuzzy Target
*** Target with CUSTOMID
    :CUSTOM_ID: aabbccddeeff

*** Dedicated Target
#   <<Dedicated Target>>    

*** <<<Radioed Target>>>
** References

*** References to Fuzzy Target
    This is a link to [[Fuzzy Target]].
*** References to CUSTOMID links
    This link to  [[#aabbccddeeff][CUSTOMID Target]] is broken.
*** References to Dedicated Target
    There is a link to nodesc [[Dedicated Target]] here. There is a link
    to [[Dedicated%20Target][Jump to Dedicated Target]] here.
*** References to Radioed Links
    This section has references to Radioed Target. One more reference
    to Radioed Target.


bash-3.2$ diff -pub customid-before.html customid-after.html 
--- customid-before.html	2010-11-17 20:36:20.140625000 +0530
+++ customid-after.html	2010-11-17 20:39:45.234375000 +0530
@@ -1,3 +1,4 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 <html xmlns="http://www.w3.org/1999/xhtml"
@@ -6,7 +7,7 @@
     <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
     <meta name="generator" content="Org-mode"/>
-    <meta name="generated" content="2010-11-17 20:35:58 "/>
+    <meta name="generated" content="2010-11-17 20:39:11 "/>
     <meta name="author" content="Jambunathan K"/>
     <meta name="description" content=""/>
     <meta name="keywords" content=""/>
@@ -100,7 +101,7 @@
-	      <li id="sec-1_1_2"><a name="sec-1_1_2" id="sec-1_1_2"></a>Target with CUSTOMID <br/>
+	      <li id="aabbccddeeff"><a name="sec-1_1_2" id="sec-1_1_2"></a>Target with CUSTOMID <br/>
@@ -199,7 +200,7 @@
 	<p class="author"> Author: Jambunathan K
 	<a href="mailto:kjambunathan@gmail.com">&lt;kjambunathan@gmail.com&gt;</a>
-	<p class="date"> Date: 2010-11-17 20:35:58 </p>
+	<p class="date"> Date: 2010-11-17 20:39:11 </p>
 	<p class="creator">HTML generated by org-mode 7.3 in emacs 23</p>


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

From 7e18408ee3250ce829dba3585ac83d13dcc11bb2 Mon Sep 17 00:00:00 2001
From: Jambunathan K <kjambunathan@gmail.com>
Date: Wed, 17 Nov 2010 20:34:17 +0530
Subject: [PATCH 2/2] Fix broken CUSTOM_ID links to outline levels exported as lists

(org-html-level-start): Modified.

 lisp/org-html.el |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 4305af2..d1fe06d 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -2320,10 +2320,9 @@ When TITLE is nil, just close all open levels."
 	 (extra-class (and title (org-get-text-property-any 0 'html-container-class title)))
 	 (preferred (and target
 			 (cdr (assoc target org-export-preferred-target-alist))))
-	 (remove (or preferred target))
 	 (l org-level-max)
 	 snumber snu href suffix)
-    (setq extra-targets (remove remove extra-targets))
+    (setq extra-targets (remove (or preferred target) extra-targets))
     (setq extra-targets
 	  (mapconcat (lambda (x)
 		       (if (org-uuidgen-p x) (setq x (concat "ID-" x)))
@@ -2362,12 +2361,13 @@ When TITLE is nil, just close all open levels."
 		  (if target
-		      (insert (format "<li id=\"%s\">" target) extra-targets title "<br/>\n")
+		      (insert (format "<li id=\"%s\">" (or preferred target))
+			      extra-targets title "<br/>\n")
 		    (insert "<li>" title "<br/>\n")))
 	      (aset org-levels-open (1- level) t)
 	      (if target
-		  (insert (format "<ul>\n<li id=\"%s\">" target)
+		  (insert (format "<ul>\n<li id=\"%s\">" (or preferred target))
 			  extra-targets title "<br/>\n")
 		(insert "<ul>\n<li>" title "<br/>\n"))))
 	(aset org-levels-open (1- level) t)

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

Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.

  reply	other threads:[~2010-11-17 15:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-05 17:53 Broken CUSTOMID links Jambunathan K
2010-11-06 19:36 ` Carsten Dominik
2010-11-08 13:39   ` [PATCH 2/2] Fix broken CUSTOM_ID links Jambunathan K
2010-11-12 15:50     ` Carsten Dominik
2010-11-17 13:26       ` Carsten Dominik
2010-11-17 15:22         ` Jambunathan K [this message]
2010-11-21  8:45           ` [PATCH: RESUBMITTED] " Carsten Dominik
2010-11-17 15:22         ` Jambunathan K

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:

  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=814obgnf07.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH: RESUBMITTED] Fix broken CUSTOM_ID links' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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


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).