Hi Marcin, Marcin Borkowski <mb...@wmi.amu.edu.pl> writes:
> I'd like to have a <p class="myfunnyclass"> in export. I tried > #+ATTR_HTML :class myfunnyclass > but it didn't work. You can't for now but this patch will make it work.
diff --git a/lisp/ox-html.el b/lisp/ox-html.el index a843441..76472c7 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2899,6 +2899,8 @@ the plist used as a communication channel." (let* ((parent (org-export-get-parent paragraph)) (parent-type (org-element-type parent)) (style '((footnote-definition " class=\"footpara\""))) + (class0 (org-export-read-attribute :attr_html paragraph :class)) + (class (if class0 (format " class=\"%s\"" class0))) (extra (or (cadr (assoc parent-type style)) ""))) (cond ((and (eq (org-element-type parent) 'item) @@ -2925,7 +2927,7 @@ the plist used as a communication channel." (label (org-element-property :name paragraph))) (org-html--wrap-image contents info caption label))) ;; Regular paragraph. - (t (format "<p%s>\n%s</p>" extra contents))))) + (t (format "<p%s%s>\n%s</p>" class extra contents))))) ;;;; Plain List
-- Bastien