HTML export: Fix bugs with footnotes.

This commit is contained in:
Carsten Dominik 2009-08-16 06:41:30 +02:00
parent 05f25b3de4
commit 94d91eaf03
2 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2009-08-16 Carsten Dominik <carsten.dominik@gmail.com>
* org-html.el (org-export-as-html): Fix bug in footnote regexp.
(org-export-as-html): Format footnotes correctly.
2009-08-14 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-fast-tag-selection): Avoid text properties on tags

View File

@ -1161,7 +1161,7 @@ lang=\"%s\" xml:lang=\"%s\">
;; Does this contain a reference to a footnote?
(when org-export-with-footnotes
(setq start 0)
(while (string-match "\\([^* \t].*\\)?\\[\\([0-9]+\\)\\]" line start)
(while (string-match "\\([^* \t].*?\\)\\[\\([0-9]+\\)\\]" line start)
(if (get-text-property (match-beginning 2) 'org-protected line)
(setq start (match-end 2))
(let ((n (match-string 2 line)) extra a)
@ -1174,10 +1174,10 @@ lang=\"%s\" xml:lang=\"%s\">
(setq line
(replace-match
(format
(concat (if (match-string 1 line) "%s" "")
(concat "%s"
(format org-export-html-footnote-format
"<a class=\"footref\" name=\"fnr.%s%s\" href=\"#fn.%s\">%s</a>"))
(match-string 1 line) n extra n n)
(or (match-string 1 line) "") n extra n n)
t t line))))))
(cond
@ -1331,10 +1331,11 @@ lang=\"%s\" xml:lang=\"%s\">
(let ((n (match-string 1 line)))
(setq org-par-open t
line (replace-match
(concat "<p class=\"footnote\">"
(format org-export-html-footnote-format
"<a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a>"
n n n) t t line))))))
(format
(concat "<p class=\"footnote\">"
(format org-export-html-footnote-format
"<a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a>"))
n n n) t t line)))))
;; Check if the line break needs to be conserved
(cond
((string-match "\\\\\\\\[ \t]*$" line)