[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Is it possible to add a class to a paragraph in HTML export?
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Is it possible to add a class to a paragraph in HTML export? |
Date: |
Wed, 02 Apr 2014 09:06:48 +0200 |
Hello,
Bastien <address@hidden> writes:
> + (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)))))
If deemed useful, I think this patch should use
`org-html--make-attribute-string' instead of hard-coding "class"
attribute:
(attributes (org-html--make-attribute-string
(org-export-read-attribute :attr_html paragraph)))
...
(t (format "<p%s%s>\n%s</p>" attributes extra contents))
This way, attributes will not be limited to "class" only. See, for
example, `org-html-special-block'.
Regards,
--
Nicolas Goaziou