emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* HTML lists are including paragraphs (<li><p>…</p></li>)
@ 2014-08-04  4:52 Daniel Clemente
  2014-08-04 19:25 ` Nick Dokos
  2014-08-05 12:06 ` Eric Schulte
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Clemente @ 2014-08-04  4:52 UTC (permalink / raw)
  To: org-mode Mailinglist


Hi. With latest org I'm getting <li><p>…</p></li>, which makes no sense; it should be <li>…</li>
Aren't there tests to find this type of breakages in export?


Example:

- hola
- uno
  - dos
- tres


Is exported to:


<ul class="org-ul">
<li><p>
hola
</p>
</li>
<li><p>
uno
</p>
<ul class="org-ul">
<li>dos
</li>
</ul>
</li>
<li><p>
tres
</p>
</li>
</ul>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: HTML lists are including paragraphs (<li><p>…</p></li>)
  2014-08-04  4:52 HTML lists are including paragraphs (<li><p>…</p></li>) Daniel Clemente
@ 2014-08-04 19:25 ` Nick Dokos
  2014-08-05 12:06 ` Eric Schulte
  1 sibling, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2014-08-04 19:25 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Eric Schulte

Daniel Clemente <n142857@gmail.com> writes:

> Hi. With latest org I'm getting <li><p>…</p></li>, which makes no sense; it should be <li>…</li>
> Aren't there tests to find this type of breakages in export?
>
>
> Example:
>
> - hola
> - uno
>   - dos
> - tres
>
>
> Is exported to:
>
>
> <ul class="org-ul">
> <li><p>
> hola
> </p>
> </li>
> <li><p>
> uno
> </p>
> <ul class="org-ul">
> <li>dos
> </li>
> </ul>
> </li>
> <li><p>
> tres
> </p>
> </li>
> </ul>

Confirmed. Bisection fingers this commit:

,----
| 1c3bdbb80a143664ca719a8a8b439390c42e28a2 is the first bad commit
| commit 1c3bdbb80a143664ca719a8a8b439390c42e28a2
| Author: Eric Schulte <schulte.eric@gmail.com>
| Date:   Mon Jun 23 17:33:18 2014 -0400
| 
|     inhibit <p> wraps on a whole-list basis
|     
|     * lisp/ox-html.el (org-html-paragraph): Extend the special case of
|       inhibiting <p> wrappers to only perform such inhibition when *every*
|       element of the list is a single paragraph long.  Otherwise unsightly
|       spacing results.
`----

-- 
Nick

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: HTML lists are including paragraphs (<li><p>…</p></li>)
  2014-08-04  4:52 HTML lists are including paragraphs (<li><p>…</p></li>) Daniel Clemente
  2014-08-04 19:25 ` Nick Dokos
@ 2014-08-05 12:06 ` Eric Schulte
  2014-08-06 12:12   ` Nicolas Goaziou
  1 sibling, 1 reply; 9+ messages in thread
From: Eric Schulte @ 2014-08-05 12:06 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: org-mode Mailinglist

The code which checks to ensure that paragraph wrappers are only
inhibited if they are inhibited for the whole list mistakenly keeps
paragraph wrappers if one item of the list is itself a list

The location of this bug is the (cdr contents) in line 2899 of
ox-html.el.  I'd be inclined to remove this form, but I'm not sure what
valid case it checks for.

Best,
Eric

Daniel Clemente <n142857@gmail.com> writes:

> Hi. With latest org I'm getting <li><p>…</p></li>, which makes no
> sense; it should be <li>…</li>
> Aren't there tests to find this type of breakages in export?
>
>
> Example:
>
> - hola
> - uno
>   - dos
> - tres
>
>
> Is exported to:
>
>
> <ul class="org-ul">
> <li><p>
> hola
> </p>
> </li>
> <li><p>
> uno
> </p>
> <ul class="org-ul">
> <li>dos
> </li>
> </ul>
> </li>
> <li><p>
> tres
> </p>
> </li>
> </ul>
>

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: HTML lists are including paragraphs (<li><p>…</p></li>)
  2014-08-05 12:06 ` Eric Schulte
@ 2014-08-06 12:12   ` Nicolas Goaziou
  2014-08-25  7:48     ` Daniel Clemente
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2014-08-06 12:12 UTC (permalink / raw)
  To: Eric Schulte; +Cc: org-mode Mailinglist

Hello,

Eric Schulte <schulte.eric@gmail.com> writes:

> The code which checks to ensure that paragraph wrappers are only
> inhibited if they are inhibited for the whole list mistakenly keeps
> paragraph wrappers if one item of the list is itself a list
>
> The location of this bug is the (cdr contents) in line 2899 of
> ox-html.el.  I'd be inclined to remove this form, but I'm not sure what
> valid case it checks for.

This is more a misunderstanding that a bug. (cdr contents) tests if
there is anything after the current paragraph. In the following example,

  1. hola
  2. uno
     - dos
  3. tres

item "2." contains (paragraph plain-list), so (cdr contents) in not nil.

I understand that "paragraph is alone in its item" is not a good test to
skip paragraph wrappers. I'm still confused about what a good test would
be. In particular, what should be done in the following cases

  - item
  - item
    - subist
    resuming item

i.e., (paragraph plain-list paragraph), and

  - outer

    another paragraph

    - inner
    - simple list

i.e., are nested plain-lists independent relatively to paragraph
wrappers skipping. I think so, but I'd rather make sure.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: HTML lists are including paragraphs (<li><p>…</p></li>)
  2014-08-06 12:12   ` Nicolas Goaziou
@ 2014-08-25  7:48     ` Daniel Clemente
  2014-08-25  8:30       ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Clemente @ 2014-08-25  7:48 UTC (permalink / raw)
  To: Eric Schulte, org-mode Mailinglist

El Wed, 06 Aug 2014 14:12:21 +0200 Nicolas Goaziou va escriure:
> 
> I understand that "paragraph is alone in its item" is not a good test to
> skip paragraph wrappers. I'm still confused about what a good test would
> be. In particular, what should be done in the following cases
> 
>   - item
>   - item
>     - sublist
>     resuming item
>

  You mean „item“ contains text+ol+p? Rather strange… I first thought that „resuming item“ would be a continuation line of „sublist“ (that is, as if „sublist resuming item“ were the only item of the sublist).
  But why not, as a general rule, avoid <p> for the first elements of lists? That is, don't output paragraph+list+paragraph, but text+list+paragraph.
  This works for the simple case (<li>text</li>) and allows the complex ones (<li>text<p>aa</p><ol></ol><whatever></whatever></li>).

  
> i.e., (paragraph plain-list paragraph), and
> 
>   - outer
> 
>     another paragraph
> 
>     - inner
>     - simple list
> 
> i.e., are nested plain-lists independent relatively to paragraph
> wrappers skipping. I think so, but I'd rather make sure.
> 

I'd also say text+p+ol.

Rather unusual syntax anyway… but it shouldn't break the simple <li>Plain item</li> (now broken).

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: HTML lists are including paragraphs (<li><p>…</p></li>)
  2014-08-25  7:48     ` Daniel Clemente
@ 2014-08-25  8:30       ` Nicolas Goaziou
  2014-08-26  7:36         ` Daniel Clemente
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2014-08-25  8:30 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: org-mode Mailinglist, Eric Schulte

Hello,

Daniel Clemente <n142857@gmail.com> writes:

>   But why not, as a general rule, avoid <p> for the first elements of lists? That is, don't output paragraph+list+paragraph, but text+list+paragraph.
>   This works for the simple case (<li>text</li>) and allows the
>   complex ones (<li>text<p>aa</p><ol></ol><whatever></whatever></li>).

This was the original behaviour, which was, apparently, unsatisfactory.
See

  http://article.gmane.org/gmane.emacs.orgmode/87898


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: HTML lists are including paragraphs (<li><p>…</p></li>)
  2014-08-25  8:30       ` Nicolas Goaziou
@ 2014-08-26  7:36         ` Daniel Clemente
  2014-08-26  7:59           ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Clemente @ 2014-08-26  7:36 UTC (permalink / raw)
  To: Eric Schulte, org-mode Mailinglist

El Mon, 25 Aug 2014 10:30:27 +0200 Nicolas Goaziou va escriure:

> >   But why not, as a general rule, avoid <p> for the first elements of lists? That is, don't output paragraph+list+paragraph, but text+list+paragraph.
> >   This works for the simple case (<li>text</li>) and allows the
> >   complex ones (<li>text<p>aa</p><ol></ol><whatever></whatever></li>).
> 
> This was the original behaviour, which was, apparently, unsatisfactory.
> See
> 
>   http://article.gmane.org/gmane.emacs.orgmode/87898
> 
> 

  Ok, let's keep the complex cases possible, but the simple ones simple. So:
- <li>text</li> and <li>text<ul/></li> if there's only 1 text or sublist or text+sublist
- <li>[normal flow including p,ol,ul,blockquote,…]</li> in the rest. This includes <li><p/><p/></li>, <li><p/><ol/><p/></li>, <li><ol><p/></li>, <li><p/><p/><ol/></li>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: HTML lists are including paragraphs (<li><p>…</p></li>)
  2014-08-26  7:36         ` Daniel Clemente
@ 2014-08-26  7:59           ` Nicolas Goaziou
  2014-08-27 14:50             ` Daniel Clemente
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2014-08-26  7:59 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: org-mode Mailinglist, Eric Schulte

Daniel Clemente <n142857@gmail.com> writes:

>   Ok, let's keep the complex cases possible, but the simple ones simple. So:
> - <li>text</li> and <li>text<ul/></li> if there's only 1 text or sublist or text+sublist
> - <li>[normal flow including p,ol,ul,blockquote,…]</li> in the rest.
> This includes <li><p/><p/></li>, <li><p/><ol/><p/></li>,
> <li><ol><p/></li>, <li><p/><p/><ol/></li>

Fair enough. This is now implemented in master. Please report if it
isn't working as expected.

Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: HTML lists are including paragraphs (<li><p>…</p></li>)
  2014-08-26  7:59           ` Nicolas Goaziou
@ 2014-08-27 14:50             ` Daniel Clemente
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Clemente @ 2014-08-27 14:50 UTC (permalink / raw)
  To: org-mode Mailinglist


It works very well now, thank you.


El Tue, 26 Aug 2014 09:59:24 +0200 Nicolas Goaziou va escriure:
> 
> Daniel Clemente <n142857@gmail.com> writes:
> 
> >   Ok, let's keep the complex cases possible, but the simple ones simple. So:
> > - <li>text</li> and <li>text<ul/></li> if there's only 1 text or sublist or text+sublist
> > - <li>[normal flow including p,ol,ul,blockquote,…]</li> in the rest.
> > This includes <li><p/><p/></li>, <li><p/><ol/><p/></li>,
> > <li><ol><p/></li>, <li><p/><p/><ol/></li>
> 
> Fair enough. This is now implemented in master. Please report if it
> isn't working as expected.
> 
> Thank you.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-08-27 14:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-04  4:52 HTML lists are including paragraphs (<li><p>…</p></li>) Daniel Clemente
2014-08-04 19:25 ` Nick Dokos
2014-08-05 12:06 ` Eric Schulte
2014-08-06 12:12   ` Nicolas Goaziou
2014-08-25  7:48     ` Daniel Clemente
2014-08-25  8:30       ` Nicolas Goaziou
2014-08-26  7:36         ` Daniel Clemente
2014-08-26  7:59           ` Nicolas Goaziou
2014-08-27 14:50             ` Daniel Clemente

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).