emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: [ox-html, patch] trim contents on list-items
Date: Tue, 16 Dec 2014 13:56:15 +0100	[thread overview]
Message-ID: <87oar3ycr4.fsf@gmx.us> (raw)

[-- Attachment #1: Type: text/plain, Size: 479 bytes --]

Hi,

I use CSS to make inlined lists in html:

     #text-sec ul {margin: 0; padding: 0; list-style: none;}
     #text-sec li {display: inline;}
     #text-sec li:after {content: ", ";}
     #text-sec li:last-child:after {content: "";}

However, since (list-)items are formatted like

    <li>whatever
    </li>

CSS adds a spurious space in front of my comma...  Anybody feel strongly
in favor of keeping this newline?  Or can I push this patch?

—Rasmus

-- 
C is for Cookie

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-html.el-Trim-list-items.patch --]
[-- Type: text/x-diff, Size: 761 bytes --]

From c990d10b6a649e169ad6bfae61063b597d735771 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
Date: Tue, 16 Dec 2014 13:49:08 +0100
Subject: [PATCH] ox-html.el: Trim list items

* ox-html.el (org-html-format-list-item): Trim contents to avoid
  spurious space.
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 178642d..82073dd 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2508,7 +2508,7 @@ INFO is a plist holding contextual information.  See
 			  class (concat checkbox term))
 		  "<dd>"))))
      (unless (eq type 'descriptive) checkbox)
-     contents
+     (org-trim contents)
      (case type
        (ordered "</li>")
        (unordered "</li>")
-- 
2.1.3


             reply	other threads:[~2014-12-16 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 12:56 Rasmus [this message]
2014-12-20 21:52 ` [ox-html, patch] trim contents on list-items Nicolas Goaziou
2014-12-21  0:21   ` Rasmus

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=87oar3ycr4.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    /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).