Browse Source

inhibit <p> wraps on a whole-list basis

* lisp/ox-html.el (org-html-paragraph): Extend the special case of
  inhibiting <p> wrappers to only perform such inhibition when *every*
  element of the list is a single paragraph long.  Otherwise unsightly
  spacing results.
Eric Schulte 10 years ago
parent
commit
1c3bdbb80a
1 changed files with 11 additions and 2 deletions
  1. 11 2
      lisp/ox-html.el

+ 11 - 2
lisp/ox-html.el

@@ -2956,8 +2956,17 @@ the plist used as a communication channel."
     (cond
      ((and (eq (org-element-type parent) 'item)
 	   (= (org-element-property :begin paragraph)
-	      (org-element-property :contents-begin parent)))
-      ;; Leading paragraph in a list item have no tags.
+	      (org-element-property :contents-begin parent))
+	   (not (org-element-map (org-export-get-parent parent) 'item
+		  (lambda (item)
+		    (let ((contents (org-element-contents item)))
+		      (and contents
+			   (or (cdr contents)
+			       (not (eq (org-element-type (car contents))
+					'paragraph))))))
+		  info 'first-match 'item)))
+      ;; Leading paragraph in a list item have no tags if every
+      ;; element of the containing list is only a single paragraph.
       contents)
      ((org-html-standalone-image-p paragraph info)
       ;; Standalone image.