Ver código fonte

Export: Interpret \par for HTML export.

"\par" will now be translated into "</p ><p >", so that this can be
used inside a footnote.
Carsten Dominik 16 anos atrás
pai
commit
3667772d15
3 arquivos alterados com 12 adições e 2 exclusões
  1. 3 2
      doc/org.texi
  2. 2 0
      lisp/ChangeLog
  3. 7 0
      lisp/org-exp.el

+ 3 - 2
doc/org.texi

@@ -1378,8 +1378,9 @@ Org-mode supports the creation of footnotes.  In contrast to the
 larger document, not only for one-off documents like emails.  The basic
 syntax is similar to the one used by @file{footnote.el}, i.e. a footnote is
 defined in a paragraph that is started by a footnote marker in square
-brackets in column 0, no indentation allowed.  The footnote reference is
-simply the marker in square brackets, inside text.  For example:
+brackets in column 0, no indentation allowed.  If you need a paragraph break
+inside a footnote, use the LaTeX idiom @samp{\par}.  The footnote reference
+is simply the marker in square brackets, inside text.  For example:
 
 @example
 The Org homepage[fn:1] now looks a lot better than it used to.

+ 2 - 0
lisp/ChangeLog

@@ -1,5 +1,7 @@
 2009-01-25  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-export-as-html): Turn \par into a paragraph.
+
 	* org.el (org-agenda-tags-todo-honor-ignore-options): Declare
 	variable.
 

+ 7 - 0
lisp/org-exp.el

@@ -3884,6 +3884,13 @@ lang=\"%s\" xml:lang=\"%s\">
 	     (org-export-preserve-breaks
 	      (setq line (concat line "<br/>"))))
 
+	    ;; Check if a paragraph should be started
+	    (while (and org-par-open
+			(string-match "\\\\par\\>" line))
+	      ;; Leave a space in the </p> so that the footnote matcher
+	      ;; does not see this.
+	      (setq line (replace-match "</p ><p >" t t line)))
+
 	    (insert line "\n")))))
 
       ;; Properly close all local lists and other lists