public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* inconsistent handling of lists
@ 2016-11-12 17:30 Erik Løvlie
       [not found] ` <73dc56d9-913a-4136-af9e-57db513670c8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Løvlie @ 2016-11-12 17:30 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1552 bytes --]

I'm seeing some inconsistent handling of lists in a commonmark document. 
Afaict a list with a single item is treated slightly differently from lists 
with multiple items.

The document (not including %%% etc):

%%%%%%
- foo
  + foo 1

- bar

blabla

- baz
  + baz 1
%%%%%%

Output:

<ul>
<li><p>foo</p>
<ul>
<li>foo 1</li>
</ul></li>
<li><p>bar</p></li>
</ul>
<p>blabla</p>
<ul>
<li>baz
<ul>
<li>baz 1</li>
</ul></li>
</ul>

I would have expected "foo" and "baz" to either both be in p tags or none 
of them. The resulting html ends up looking wonky.

Adding another list item below "baz" makes a difference:

<ul>
<li><p>foo</p>
<ul>
<li>foo 1</li>
</ul></li>
<li><p>bar</p></li>
</ul>
<p>blabla</p>
<ul>
<li><p>baz</p>
<ul>
<li>baz 1</li>
</ul></li>
<li><p>yo</p></li>
</ul>

Note that "baz" is now in p tags, same as "foo".

Pandoc installed using homebrew:

$ pandoc --version
pandoc 1.18
Compiled with pandoc-types 1.17.0.4, texmath 0.8.6.6, highlighting-kate 
0.6.3

/Erik

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/73dc56d9-913a-4136-af9e-57db513670c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2527 bytes --]

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

* Re: inconsistent handling of lists
       [not found] ` <73dc56d9-913a-4136-af9e-57db513670c8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-11-12 17:32   ` Erik Løvlie
  2016-11-12 21:52   ` John MacFarlane
  1 sibling, 0 replies; 4+ messages in thread
From: Erik Løvlie @ 2016-11-12 17:32 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1920 bytes --]

Oh, I should probably state how I'm running pandoc:

pandoc -f commonmark -o foo.html foo.md

On Saturday, November 12, 2016 at 6:30:19 PM UTC+1, Erik Løvlie wrote:
>
> I'm seeing some inconsistent handling of lists in a commonmark document. 
> Afaict a list with a single item is treated slightly differently from lists 
> with multiple items.
>
> The document (not including %%% etc):
>
> %%%%%%
> - foo
>   + foo 1
>
> - bar
>
> blabla
>
> - baz
>   + baz 1
> %%%%%%
>
> Output:
>
> <ul>
> <li><p>foo</p>
> <ul>
> <li>foo 1</li>
> </ul></li>
> <li><p>bar</p></li>
> </ul>
> <p>blabla</p>
> <ul>
> <li>baz
> <ul>
> <li>baz 1</li>
> </ul></li>
> </ul>
>
> I would have expected "foo" and "baz" to either both be in p tags or none 
> of them. The resulting html ends up looking wonky.
>
> Adding another list item below "baz" makes a difference:
>
> <ul>
> <li><p>foo</p>
> <ul>
> <li>foo 1</li>
> </ul></li>
> <li><p>bar</p></li>
> </ul>
> <p>blabla</p>
> <ul>
> <li><p>baz</p>
> <ul>
> <li>baz 1</li>
> </ul></li>
> <li><p>yo</p></li>
> </ul>
>
> Note that "baz" is now in p tags, same as "foo".
>
> Pandoc installed using homebrew:
>
> $ pandoc --version
> pandoc 1.18
> Compiled with pandoc-types 1.17.0.4, texmath 0.8.6.6, highlighting-kate 
> 0.6.3
>
> /Erik
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7c1cc2c7-d142-4a9f-8943-5681c5cbb3aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2858 bytes --]

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

* Re: inconsistent handling of lists
       [not found] ` <73dc56d9-913a-4136-af9e-57db513670c8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2016-11-12 17:32   ` Erik Løvlie
@ 2016-11-12 21:52   ` John MacFarlane
       [not found]     ` <20161112215227.GA79029-jF64zX8BO0+FMlDNSLpt5EEMvNT87kid@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2016-11-12 21:52 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

See the CommonMark spec for the distinction between
"tight" and "loose" lists.

You have two lists.  The first,

- foo
  + foo 1

- bar

is "loose" because of the blank space between items.

The second,

- baz
  + baz 1

is tight because there is no blank space between items.

You might say:  if you have a one-element list, how can
you put blank space between items?  Of course you can't.
So such lists are always tight.  I don't know a better
solution.


+++ Erik Løvlie [Nov 12 16 09:30 ]:
>   I'm seeing some inconsistent handling of lists in a commonmark
>   document. Afaict a list with a single item is treated slightly
>   differently from lists with multiple items.
>   The document (not including %%% etc):
>   %%%%%%
>   - foo
>     + foo 1
>   - bar
>   blabla
>   - baz
>     + baz 1
>   %%%%%%
>   Output:
>   <ul>
>   <li><p>foo</p>
>   <ul>
>   <li>foo 1</li>
>   </ul></li>
>   <li><p>bar</p></li>
>   </ul>
>   <p>blabla</p>
>   <ul>
>   <li>baz
>   <ul>
>   <li>baz 1</li>
>   </ul></li>
>   </ul>
>   I would have expected "foo" and "baz" to either both be in p tags or
>   none of them. The resulting html ends up looking wonky.
>   Adding another list item below "baz" makes a difference:
>   <ul>
>   <li><p>foo</p>
>   <ul>
>   <li>foo 1</li>
>   </ul></li>
>   <li><p>bar</p></li>
>   </ul>
>   <p>blabla</p>
>   <ul>
>   <li><p>baz</p>
>   <ul>
>   <li>baz 1</li>
>   </ul></li>
>   <li><p>yo</p></li>
>   </ul>
>   Note that "baz" is now in p tags, same as "foo".
>   Pandoc installed using homebrew:
>   $ pandoc --version
>   pandoc 1.18
>   Compiled with pandoc-types 1.17.0.4, texmath 0.8.6.6, highlighting-kate
>   0.6.3
>   /Erik
>
>   --
>   You received this message because you are subscribed to the Google
>   Groups "pandoc-discuss" group.
>   To unsubscribe from this group and stop receiving emails from it, send
>   an email to [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [3]https://groups.google.com/d/msgid/pandoc-discuss/73dc56d9-913a-4136-
>   af9e-57db513670c8%40googlegroups.com.
>   For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. https://groups.google.com/d/msgid/pandoc-discuss/73dc56d9-913a-4136-af9e-57db513670c8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   4. https://groups.google.com/d/optout

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20161112215227.GA79029%40MacBook-Air-2.home.
For more options, visit https://groups.google.com/d/optout.


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

* Re: inconsistent handling of lists
       [not found]     ` <20161112215227.GA79029-jF64zX8BO0+FMlDNSLpt5EEMvNT87kid@public.gmane.org>
@ 2016-11-12 22:15       ` Erik Løvlie
  0 siblings, 0 replies; 4+ messages in thread
From: Erik Løvlie @ 2016-11-12 22:15 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 754 bytes --]

On Saturday, November 12, 2016 at 10:52:31 PM UTC+1, John MacFarlane wrote:
>
> See the CommonMark spec for the distinction between 
> "tight" and "loose" lists. 
>
>
Ah, thanks :) 

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7a3cad8c-520e-487d-8cf4-acb1bab7e175%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 1337 bytes --]

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

end of thread, other threads:[~2016-11-12 22:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-12 17:30 inconsistent handling of lists Erik Løvlie
     [not found] ` <73dc56d9-913a-4136-af9e-57db513670c8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-12 17:32   ` Erik Løvlie
2016-11-12 21:52   ` John MacFarlane
     [not found]     ` <20161112215227.GA79029-jF64zX8BO0+FMlDNSLpt5EEMvNT87kid@public.gmane.org>
2016-11-12 22:15       ` Erik Løvlie

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 NNTP newsgroup(s).