emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Bug with section numbers due to EXAMPLE block


From: Daniel Clemente
Subject: [Orgmode] Bug with section numbers due to EXAMPLE block
Date: Mon, 01 Mar 2010 02:29:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux)

  Hi, I found an HTML export bug with org-mode 6.34c-140-g44c8 and older. I 
used:

--------------------------------------------------------
* only one section
#+BEGIN_EXAMPLE:
  
  We need:
  ,* pears
  ,* lettuce
  ,* watermelons
  
  Very important!
#+END_EXAMPLE:
--------------------------------------------------------

  And the outputed table of contents had this code:

--------------------------------------------------------
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 only one section </a></li>
<li><a href="#sec-2">2 pears</a></li>
<li><a href="#sec-3">3 lettuce</a></li>
<li><a href="#sec-4">4 watermelons</a></li>
</ul>
</div>
--------------------------------------------------------

  This is wrong because the asterisks inside the example don't represent 
headers. There should be only one header.

  It does not happen with QUOTE or VERSE or SRC or CENTER! Only with EXAMPLE!


  I found this related code in org-export-replace-src-segments-and-examples:

#+BEGIN_SRC lisp
                    ;; Free up the protected lines
                    (goto-char (point-min))
                    (while (re-search-forward "^," nil t)
                      (if (or (equal lang "org")
                              (save-match-data
                                (looking-at "\\([*#]\\|[ \t]*#\\+\\)")))
                          (replace-match ""))
                      (end-of-line 1))
#+END_SRC

(looking-at "\\([*#]\\|[ \t]*#\\+\\)") is true and therefore the , is removed 
and the asterisks are free.

  Maybe that block should be marked as „this is not org syntax“, or the section 
numbers should be computed before evaluating example blocks.


  Greetings
Daniel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]