Browse Source

Fix list item class attribute.

* lisp/ox-html.el (org-html-format-list-item): Make sure checkbox type
  class attribute only added to list item if item is a checkbox.
Rick Frankel 11 năm trước cách đây
mục cha
commit
dd8b3cbf36
1 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 6 4
      lisp/ox-html.el

+ 6 - 4
lisp/ox-html.el

@@ -2486,7 +2486,9 @@ INFO is a plist holding contextual information.  See
 					     &optional term-counter-id
 					     headline)
   "Format a list item into HTML."
-  (let ((class (symbol-name checkbox))
+  (let ((class (if checkbox
+		   (format " class=\"%s\""
+			   (symbol-name checkbox)) ""))
 	(checkbox (concat (org-html-checkbox checkbox info)
 			  (and checkbox " ")))
 	(br (org-html-close-tag "br" nil info)))
@@ -2496,19 +2498,19 @@ INFO is a plist holding contextual information.  See
 	(let* ((counter term-counter-id)
 	       (extra (if counter (format " value=\"%s\"" counter) "")))
 	  (concat
-	   (format "<li class=\"%s\"%s>" class extra)
+	   (format "<li%s%s>" class extra)
 	   (when headline (concat headline br)))))
        (unordered
 	(let* ((id term-counter-id)
 	       (extra (if id (format " id=\"%s\"" id) "")))
 	  (concat
-	   (format "<li class=\"%s\"%s>" class extra)
+	   (format "<li%s%s>" class extra)
 	   (when headline (concat headline br)))))
        (descriptive
 	(let* ((term term-counter-id))
 	  (setq term (or term "(no term)"))
 	  ;; Check-boxes in descriptive lists are associated to tag.
-	  (concat (format "<dt class=\"%s\">%s</dt>"
+	  (concat (format "<dt%s>%s</dt>"
 			  class (concat checkbox term))
 		  "<dd>"))))
      (unless (eq type 'descriptive) checkbox)