Переглянути джерело

HTML export: Fix bug with horizontal rules in plain lists.

Brenton Kenkel writes:

> I'm using org-mode 6.28e on Aquamacs (based on GNU Emacs
> 22.3.1) on Mac OS X. I'm having an issue with horizontal
> rules and lists in HTML export. When I export the following
> to HTML, the horizontal rule tag is generated within the
> unordered list, rather than after it ends:
>
> ,-----
> | * test
> |
> | - this is a list
> |
> |
> | -----
> |
> | * next section
> |
> | No list.
> |
> |
> | -----
> |
> `-----
>
> I want the first horizontal rule to be even with the second;
> namely, extending all the way to the left. Any way to do
> this?
Carsten Dominik 16 роки тому
батько
коміт
3788dc336f
2 змінених файлів з 12 додано та 7 видалено
  1. 5 0
      lisp/ChangeLog
  2. 7 7
      lisp/org-html.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2009-07-27  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-html.el (org-export-as-html): Move hrule detection to after
+	plain list handling.
+
 2009-07-26  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-html.el (org-format-org-table-html): Fix colgroup tags.

+ 7 - 7
lisp/org-html.el

@@ -920,13 +920,6 @@ lang=\"%s\" xml:lang=\"%s\">
 	      (and par (insert "<p>\n")))
 	    (throw 'nextline nil))
 
-	  ;; Horizontal line
-	  (when (string-match "^[ \t]*-\\{5,\\}[ \t]*$" line)
-	    (if org-par-open
-		(insert "\n</p>\n<hr/>\n<p>\n")
-	      (insert "\n<hr/>\n"))
-	    (throw 'nextline nil))
-
 	  ;; Blockquotes, verse, and center
 	  (when (equal "ORG-BLOCKQUOTE-START" line)
 	    (org-close-par-maybe)
@@ -1306,6 +1299,13 @@ lang=\"%s\" xml:lang=\"%s\">
 			   "<b>[<span style=\"visibility:hidden;\">X</span>]</b>")
 			   t t line))))
 
+	    ;; Horizontal line
+	    (when (string-match "^[ \t]*-\\{5,\\}[ \t]*$" line)
+	      (if org-par-open
+		  (insert "\n</p>\n<hr/>\n<p>\n")
+		(insert "\n<hr/>\n"))
+	      (throw 'nextline nil))
+
 	    ;; Empty lines start a new paragraph.  If hand-formatted lists
 	    ;; are not fully interpreted, lines starting with "-", "+", "*"
 	    ;; also start a new paragraph.