[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] unattractive list spacing in ox-html export
From: |
Eric Schulte |
Subject: |
Re: [O] unattractive list spacing in ox-html export |
Date: |
Mon, 23 Jun 2014 20:09:55 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Nicolas Goaziou <address@hidden> writes:
> Eric Schulte <address@hidden> writes:
>
>> + ;; every subsequent list element is a single element long
>
> You need to start with a capital and a final period.
>
> Also, it could be merged with the comment below. E.g., "Paragraphs have
> no tag when any item in current list is either empty or consist of
> a single paragraph."
>
>> + (let ((gp (org-export-get-parent parent))
>
> Since you only use it once, you don't need to bind it. Just use it in
> `org-element-map':
>
> (org-element-map (org-export-get-parent parent) 'item ...)
>
>> + (all-singles t))
>> + (org-element-map gp 'item
>> + (lambda (object)
>> + (let ((num-children (length (org-element-contents object))))
>> + (unless (= 1 num-children)
>> + (setq all-singles nil))))
>> + info nil 'item)
>
> This is not sufficient, as an item could contain a single center block
> with many paragraphs within. IOW you also need to check the type of the
> single element. We also need to accept empty items.
>
> Moreover, the item could contain another element not exported (i.e.
> a comment), but I guess that would go a bit too far.
>
> Also, note that `org-element-map' has a mechanism to exit early
> (argument FIRST-MATCH), so you can avoid mapping over all items if you
> already know that one of them doesn't contain a single paragraph.
>
> I think the following should do the job:
>
> (not (org-element-map (org-export-get-parent parent) 'item
> (lambda (item)
> (let ((contents (org-element-contents item)))
> (and contents
> (or (cdr contents)
> (not (eq (org-element-type (car contents))
> 'paragraph))))))
> info 'first-match 'item))
>
>> ;; Leading paragraph in a list item have no tags.
>
> See above.
>
Applied with your changes. Thanks for initial pointer and the code
review.
Best,
Eric
>
>
> Regards,
--
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)