From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: org-mode CSS property export bug Date: Sun, 25 Apr 2010 12:27:57 +0200 Message-ID: <87och7bzde.fsf@gmx.de> References: <87y6gf5g6x.fsf@gmx.de> <877hnycuqf.fsf@gmx.de> <8739ylmdkp.fsf@gmx.de> <87wrvxum6d.fsf@gmx.de> <594FCA05-61BC-4F02-B9B3-99329275C25B@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O5z4R-0000Ay-Az for emacs-orgmode@gnu.org; Sun, 25 Apr 2010 06:28:15 -0400 Received: from [140.186.70.92] (port=46777 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5z4O-0000Aq-NB for emacs-orgmode@gnu.org; Sun, 25 Apr 2010 06:28:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O5z4J-0005Yz-0h for emacs-orgmode@gnu.org; Sun, 25 Apr 2010 06:28:12 -0400 Received: from mail.gmx.net ([213.165.64.20]:43496) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1O5z4I-0005Yu-JR for emacs-orgmode@gnu.org; Sun, 25 Apr 2010 06:28:06 -0400 In-Reply-To: <594FCA05-61BC-4F02-B9B3-99329275C25B@gmail.com> (Carsten Dominik's message of "Sat, 24 Apr 2010 17:36:27 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org Carsten, this looks all OK to me. Tested and works. Sebastian Carsten Dominik writes: > He Sebastian, > > I believe we need a bit more - here is my patch - can you please take a look? > Thanks! > > - Carsten > > Modified lisp/org-docbook.el > diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el > index de9ffcc..bb8d048 100644 > --- a/lisp/org-docbook.el > +++ b/lisp/org-docbook.el > @@ -1228,7 +1228,8 @@ When TITLE is nil, just close all open levels." > (setq section-number (org-section-number level)) > (insert (format "\n
\n%s" > org-export-docbook-section-id-prefix > - section-number title)) > + (replace-regexp-in-string "\\." "_" section-number) > + title)) > (org-export-docbook-open-para)))) > > (defun org-docbook-expand (string) > Modified lisp/org-exp.el > diff --git a/lisp/org-exp.el b/lisp/org-exp.el > index da8e1a4..44bde65 100644 > --- a/lisp/org-exp.el > +++ b/lisp/org-exp.el > @@ -1239,7 +1239,9 @@ Also find all ID and CUSTOM_ID propertiess and store > them." > (save-excursion (goto-char (point-at-bol)) > (org-outline-level)))) > (setq target (org-solidify-link-text > - (format "sec-%s" (org-section-number level)))) > + (format "sec-%s" (replace-regexp-in-string > + "\\." "_" > + (org-section-number level))))) > (setq last-section-target target) > (push (cons target target) target-alist) > (add-text-properties > Modified lisp/org-html.el > diff --git a/lisp/org-html.el b/lisp/org-html.el > index 71f62eb..92798d2 100644 > --- a/lisp/org-html.el > +++ b/lisp/org-html.el > @@ -871,7 +871,9 @@ lang=\"%s\" xml:lang=\"%s\"> > t t line))) > (while (string-match "<\\(<\\)+\\|>\\(>\\)+" txt) > (setq txt (replace-match "" t t txt))) > - (setq href (format "sec-%s" snumber)) > + (setq href > + (replace-regexp-in-string > + "\\." "_" (format "sec-%s" snumber))) > (setq href (or (cdr (assoc href org-export-preferred-target- > alist)) href)) > (push > (format > @@ -2027,7 +2029,7 @@ When TITLE is nil, just close all open levels." > (cdr (assoc target org-export-preferred-target-alist)))) > (remove (or preferred target)) > (l org-level-max) > - snumber href suffix) > + snumber snu href suffix) > (setq extra-targets (remove remove extra-targets)) > (setq extra-targets > (mapconcat (lambda (x) > @@ -2076,7 +2078,8 @@ When TITLE is nil, just close all open levels." > extra-targets title "
\n") > (insert "
    \n
  • " title "
    \n")))) > (aset org-levels-open (1- level) t) > - (setq snumber (org-section-number level)) > + (setq snumber (org-section-number level) > + snu (replace-regexp-in-string "\\." "_" snumber)) > (setq level (+ level org-export-html-toplevel-hlevel -1)) > (if (and org-export-with-section-numbers (not body-only)) > (setq title (concat > @@ -2084,9 +2087,9 @@ When TITLE is nil, just close all open levels." > level snumber) > " " title))) > (unless (= head-count 1) (insert "\n\n")) > - (setq href (cdr (assoc (concat "sec-" snumber) org-export-preferred- > target-alist))) > - (setq suffix (or href snumber)) > - (setq href (or href (concat "sec-" snumber))) > + (setq href (cdr (assoc (concat "sec-" snu) org-export-preferred- > target-alist))) > + (setq suffix (or href snu)) > + (setq href (or href (concat "sec-" snu))) > (insert (format "\n
    %d%s\">\n%s%s\n
    \"text-%s\">\n" > suffix level (if extra-class (concat " " extra-class) "") > level href > > > On Apr 24, 2010, at 1:25 PM, Sebastian Rose wrote: > >> Hi everyone, >> >> >> here's a patch for org-html.el to fix those IDs. >> >> sec-1.2 => sec-1_2 >> sec-1.2.3 => sec-1_2_3 >> >> >> >> >> diff --git a/lisp/org-html.el b/lisp/org-html.el >> index 71f62eb..133bffa 100644 >> --- a/lisp/org-html.el >> +++ b/lisp/org-html.el >> @@ -871,7 +871,9 @@ lang=\"%s\" xml:lang=\"%s\"> >> t t line))) >> (while (string-match "<\\(<\\)+\\|>\\(>\\)+" txt) >> (setq txt (replace-match "" t t txt))) >> - (setq href (format "sec-%s" snumber)) >> + (setq href >> + (replace-regexp-in-string >> + "\\." "_" (format "sec-%s" snumber))) >> (setq href (or (cdr (assoc href org-export-preferred-target- >> alist)) href)) >> (push >> (format >> @@ -2085,8 +2087,11 @@ When TITLE is nil, just close all open levels." >> " " title))) >> (unless (= head-count 1) (insert "\n
    \n")) >> (setq href (cdr (assoc (concat "sec-" snumber) org-export-preferred- >> target-alist))) >> - (setq suffix (or href snumber)) >> - (setq href (or href (concat "sec-" snumber))) >> + (setq suffix (or href >> + (replace-regexp-in-string "\\." "_" snumber))) >> + (setq href (or href >> + (replace-regexp-in-string >> + "\\." "_" (concat "sec-" snumber)))) >> (insert (format "\n
    > %d%s\">\n%s%s\n
    > id=\"text-%s\">\n" >> suffix level (if extra-class (concat " " extra-class) "") >> level href >> >> >> >> >> Who ever uses org-info.js will have to pull the new (but backward >> compatible) version from >> >> http://orgmode.org/worg/code/org-info-js/org-info.js >> >> provided this or something similar gets applied. Please give the server >> a while to run the publishing before downloading (I guess 2 hours are >> enough). It's now ... >> >> >> $ date -u >> Sa 24. Apr 11:13:26 UTC 2010 >> >> >> >> >> Best wishes >> >> Sebastian > > - Carsten > > > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sebastian Rose Fachinformatiker / Anwendungsentwicklung Viktoriastr. 22 Entwicklung von Anwendungen mit freien Werkzeugen 30451 Hannover und Bibliotheken. 0173 83 93 417 sebastian_rose@gmx.de s.rose@emma-stil.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~