From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: [PATCH 2/3] add html attributes to quote-block Date: Mon, 28 Mar 2016 15:06:51 -0400 Message-ID: <1459192012-82531-2-git-send-email-jkitchin@andrew.cmu.edu> References: <1459192012-82531-1-git-send-email-jkitchin@andrew.cmu.edu> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akcVB-0000w4-Ej for emacs-orgmode@gnu.org; Mon, 28 Mar 2016 15:07:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akcV9-0002Hx-3y for emacs-orgmode@gnu.org; Mon, 28 Mar 2016 15:07:01 -0400 Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:32896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akcV8-0002Hp-Vt for emacs-orgmode@gnu.org; Mon, 28 Mar 2016 15:06:59 -0400 Received: by mail-qg0-x231.google.com with SMTP id j35so116717209qge.0 for ; Mon, 28 Mar 2016 12:06:58 -0700 (PDT) In-Reply-To: <1459192012-82531-1-git-send-email-jkitchin@andrew.cmu.edu> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: John Kitchin Enables #+attr_html: and puts a id attribute when the block is named into the html element. --- lisp/ox-html.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 92de209..5bdfc14 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -3155,11 +3155,19 @@ holding contextual information." ;;;; Quote Block -(defun org-html-quote-block (_quote-block contents _info) +(defun org-html-quote-block (quote-block contents info) "Transcode a QUOTE-BLOCK element from Org to HTML. CONTENTS holds the contents of the block. INFO is a plist holding contextual information." - (format "
\n%s
" contents)) + (let ((attributes (org-export-read-attribute :attr_html quote-block))) + (when (org-element-property :name quote-block) + (setq attributes (plist-put + attributes :id + (org-element-property :name quote-block)))) + (setq attributes (org-html--make-attribute-string attributes)) + (when (not (equal attributes "")) + (setq attributes (concat " " attributes))) + (format "\n%s" attributes contents))) ;;;; Section -- 2.4.4