emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Org-mode mailing list <emacs-orgmode@gnu.org>,
	Marcin Borkowski <mbork@wmi.amu.edu.pl>
Subject: Re: Is it possible to add a class to a paragraph in HTML export?
Date: Wed, 02 Apr 2014 09:06:48 +0200	[thread overview]
Message-ID: <87fvlwnrav.fsf@gmail.com> (raw)
In-Reply-To: <8761msdeot.fsf@bzg.ath.cx> (Bastien's message of "Tue, 01 Apr 2014 21:37:06 +0200")

Hello,

Bastien <bzg@gnu.org> 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

  parent reply	other threads:[~2014-04-02  7:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 19:28 Is it possible to add a class to a paragraph in HTML export? Marcin Borkowski
2014-04-01 19:37 ` Bastien
2014-04-01 19:45   ` Marcin Borkowski
2014-04-02  7:06   ` Nicolas Goaziou [this message]
2014-04-02  7:58     ` Christian Moe
2014-04-17  1:13     ` Rick Frankel
2014-04-17  6:20       ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvlwnrav.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=mbork@wmi.amu.edu.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).