From d8e4a35974c4115ac3b977009b825e0cb3241e26 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 3 Mar 2009 14:05:38 +0100 Subject: [PATCH] HTML Export: Make IDs valid uuidgen ids may start with a number and therefore are not valid names in HTML. Therefore we now use and "ID-" prefix for such IDs when exporting to HTML. --- ORGWEBPAGE/Changes.org | 9 +++++++++ lisp/ChangeLog | 4 ++++ lisp/org-exp.el | 5 ++++- lisp/org.el | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org index 96bd56629..12e100fe6 100644 --- a/ORGWEBPAGE/Changes.org +++ b/ORGWEBPAGE/Changes.org @@ -26,6 +26,15 @@ with the =C-c a m= key for the corresponding agenda view. =C-c / T= will still work for now, but it is no longer advertised in the documentation and may go away at any time in the future. +*** IDs in HTML have "ID-" prefix when generated by uuidgen + +=uuidgen= generates IDs that often start with a number, not a +latter. However, IDs and names in XHTML must start with a letter. +Therefore, IDs in HTML files will now get an "ID-" prefix if they +have been generated by uuidgen. This means that id links from one +file to another may stop working until all files have been +exported again. + ** Details *** PDF export of agenda views diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35e5d3473..9b3c7d919 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2009-03-03 Carsten Dominik + * org-exp.el (org-export-as-html): Use IDs in the correct way. + + * org.el (org-uuidgen-p): New funtion. + * org-agenda.el (org-agenda-fontify-priorities): New default value `cookies'. (org-agenda-fontify-priorities): Renamed from diff --git a/lisp/org-exp.el b/lisp/org-exp.el index e8c595558..ce6670cd5 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -3745,7 +3745,9 @@ lang=\"%s\" xml:lang=\"%s\"> id-file (file-name-directory org-current-export-file))) (setq id-file (concat (file-name-sans-extension id-file) "." html-extension)) - (setq rpl (concat "" (org-export-html-format-desc desc) ""))) @@ -4738,6 +4740,7 @@ When TITLE is nil, just close all open levels." (let* ((target (and title (org-get-text-property-any 0 'target title))) (extra-targets (mapconcat (lambda (x) + (if (org-uuidgen-p x) (setq x (concat "ID-" x))) (format "" x x)) (cdr (assoc target org-export-target-aliases)) diff --git a/lisp/org.el b/lisp/org.el index 47b9fd114..5c0899b09 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14644,6 +14644,10 @@ and end of string." list))) (nreverse list))) +(defun org-uuidgen-p (s) + "Is S an ID created by UUIDGEN?" + (string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s))) + (defun org-context () "Return a list of contexts of the current cursor position. If several contexts apply, all are returned. -- 2.11.4.GIT