public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Comments within a list
@ 2021-08-20 18:11 Joseph Reagle
       [not found] ` <f554871e-a51e-5c58-502d-611a97ca95fd-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph Reagle @ 2021-08-20 18:11 UTC (permalink / raw)
  To: pandoc-discuss

I know [comments are a hack][1] to end lists, but I sometimes comment an item that isn't relevant -- but I might want to come back to. However, I'm not sure why having a comment in a list means that each <li> gets a <p> child...? That makes my lists ugly with extra spacing between the items.

```
- this is top 1
     - this is sub 1.1
     - this is sub 1.2
     <!-- - going to think about 1.3 for a bit -->
     - this is sub 1.4
- this is top 2
     - this is sub 2.1
     - this is sub 2.2
     - this is sub 2.3
```

yields (with --strip-comments)

```
     <ul>
       <li>this is top 1
         <ul>
           <li><p>this is sub 1.1</p></li>
           <li><p>this is sub 1.2</p></li>
           <li><p>this is sub 1.3</p></li>
         </ul>
       </li>
       <li>this is top 2
         <ul>
           <li>this is sub 2.1</li>
           <li>this is sub 2.2</li>
           <li>this is sub 2.3</li>
         </ul>
       </li>
     </ul>
```

[1]: https://pandoc.org/MANUAL.html#ending-a-list

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f554871e-a51e-5c58-502d-611a97ca95fd%40reagle.org.


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

* Re: Comments within a list
       [not found] ` <f554871e-a51e-5c58-502d-611a97ca95fd-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
@ 2021-08-20 18:40   ` Daniel Staal
       [not found]     ` <69e1034f-6462-61d9-45f9-3af2c9fd2a97-Jdbf3xiKgS8@public.gmane.org>
  2021-08-20 19:52   ` John MacFarlane
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Staal @ 2021-08-20 18:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 8/20/21 2:11 PM, Joseph Reagle wrote:
> I know [comments are a hack][1] to end lists, but I sometimes comment an 
> item that isn't relevant -- but I might want to come back to. However, 
> I'm not sure why having a comment in a list means that each <li> gets a 
> <p> child...? That makes my lists ugly with extra spacing between the 
> items.

Since the comment is ignored, you have an empty line between list items. 
  That converts it from a 'compact' list to a 'loose' list.

I'm not sure if there's a good fix for that for this case.  (I'll admit 
that the distinction between compact and loose lists tends to get me as 
well - it's never *quite* what I want, though the rule is simple, and I 
don't know what a better rule would be.)

Daniel T. Staal

-- 
---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------


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

* Re: Comments within a list
       [not found]     ` <69e1034f-6462-61d9-45f9-3af2c9fd2a97-Jdbf3xiKgS8@public.gmane.org>
@ 2021-08-20 18:55       ` Joseph Reagle
       [not found]         ` <decd3c8a-41f7-bcf2-addf-3e226cfc0896-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph Reagle @ 2021-08-20 18:55 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 21-08-20 14:40, Daniel Staal wrote:
> Since the comment is ignored, you have an empty line between list items.  That converts it from a 'compact' list to a 'loose' list.
> 
> I'm not sure if there's a good fix for that for this case.
Yes, compact vs loose, I'm sure you are right. As a hack, I can join/concatenate the commented line with its predecessor to preserve compactness, but that's not as easy in the text editor as a single key press to comment...

I wonder what would happen if pandoc dropped a CR/LF when immediately following a comment? Then, there'd be no blank line...

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/decd3c8a-41f7-bcf2-addf-3e226cfc0896%40reagle.org.


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

* Re: Comments within a list
       [not found]         ` <decd3c8a-41f7-bcf2-addf-3e226cfc0896-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
@ 2021-08-20 19:03           ` William Lupton
       [not found]             ` <CAEe_xxg0N37nDD4kD5UfKcJOQM6xfRPVx69cTho=11mhYxWKCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: William Lupton @ 2021-08-20 19:03 UTC (permalink / raw)
  To: pandoc-discuss

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

Does it work to escape the newline after the comment? That way it would
syntactically be on a different line.

On Fri, 20 Aug 2021, 19:55 Joseph Reagle, <joseph.2011-T1oY19WcHSwdnm+yROfE0A@public.gmane.org> wrote:

> On 21-08-20 14:40, Daniel Staal wrote:
> > Since the comment is ignored, you have an empty line between list
> items.  That converts it from a 'compact' list to a 'loose' list.
> >
> > I'm not sure if there's a good fix for that for this case.
> Yes, compact vs loose, I'm sure you are right. As a hack, I can
> join/concatenate the commented line with its predecessor to preserve
> compactness, but that's not as easy in the text editor as a single key
> press to comment...
>
> I wonder what would happen if pandoc dropped a CR/LF when immediately
> following a comment? Then, there'd be no blank line...
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/decd3c8a-41f7-bcf2-addf-3e226cfc0896%40reagle.org
> .
>

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxg0N37nDD4kD5UfKcJOQM6xfRPVx69cTho%3D11mhYxWKCQ%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 2557 bytes --]

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

* Re: Comments within a list
       [not found]             ` <CAEe_xxg0N37nDD4kD5UfKcJOQM6xfRPVx69cTho=11mhYxWKCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-08-20 19:38               ` Joseph Reagle
  0 siblings, 0 replies; 9+ messages in thread
From: Joseph Reagle @ 2021-08-20 19:38 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw



On 21-08-20 15:03, William Lupton wrote:
> Does it work to escape the newline after the comment? That way it would syntactically be on a different line.

No, and it's much uglier than the first.

```
- this is top 1
     - this is sub 1.1
     - this is sub 1.2 <!-- - going to think about 1.3 for a bit -->
     - this is sub 1.4
- this is top 2
     - this is sub 2.1
     - this is sub 2.2
<!-- - going to think about 2.3 for a bit
-->    - this is sub 2.4
```


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

* Re: Comments within a list
       [not found] ` <f554871e-a51e-5c58-502d-611a97ca95fd-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
  2021-08-20 18:40   ` Daniel Staal
@ 2021-08-20 19:52   ` John MacFarlane
       [not found]     ` <yh480k35r3x5a1.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2021-08-20 19:52 UTC (permalink / raw)
  To: Joseph Reagle, pandoc-discuss


This works:

- this is top 1
     - this is sub 1.1
     - this is sub 1.2
       <!-- - going to think about 1.3 for a bit -->
     - this is sub 1.4
- this is top 2
     - this is sub 2.1
     - this is sub 2.2
     - this is sub 2.3

You can also try -f commonmark or -f commonmark_x or -f gfm.

That will split 1.4 into a separate list, given the indentation
you have, but you can indent it as above if you don't want that.

Joseph Reagle <joseph.2011-T1oY19WcHSwdnm+yROfE0A@public.gmane.org> writes:

> I know [comments are a hack][1] to end lists, but I sometimes comment an item that isn't relevant -- but I might want to come back to. However, I'm not sure why having a comment in a list means that each <li> gets a <p> child...? That makes my lists ugly with extra spacing between the items.
>
> ```
> - this is top 1
>      - this is sub 1.1
>      - this is sub 1.2
>      <!-- - going to think about 1.3 for a bit -->
>      - this is sub 1.4
> - this is top 2
>      - this is sub 2.1
>      - this is sub 2.2
>      - this is sub 2.3
> ```
>
> yields (with --strip-comments)
>
> ```
>      <ul>
>        <li>this is top 1
>          <ul>
>            <li><p>this is sub 1.1</p></li>
>            <li><p>this is sub 1.2</p></li>
>            <li><p>this is sub 1.3</p></li>
>          </ul>
>        </li>
>        <li>this is top 2
>          <ul>
>            <li>this is sub 2.1</li>
>            <li>this is sub 2.2</li>
>            <li>this is sub 2.3</li>
>          </ul>
>        </li>
>      </ul>
> ```
>
> [1]: https://pandoc.org/MANUAL.html#ending-a-list
>
> -- 
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f554871e-a51e-5c58-502d-611a97ca95fd%40reagle.org.

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/yh480k35r3x5a1.fsf%40johnmacfarlane.net.


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

* Re: Comments within a list
       [not found]     ` <yh480k35r3x5a1.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2021-08-20 21:03       ` Joseph Reagle
       [not found]         ` <e48f774d-2904-7c9f-1d8f-b21fca3977e8-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph Reagle @ 2021-08-20 21:03 UTC (permalink / raw)
  To: John MacFarlane, pandoc-discuss

It's the `--strip-comments` option that is causing sibling items around the commented one to be stuck in <p>. I learned of the `--strip-comments` recently and added it as a default to all of my builds -- might as well as keep sleuths from seeing comments to myself. And I just now stubbed my toe on it. Was I mistaken to think this option shouldn't have other side-effects?


On 21-08-20 15:52, John MacFarlane wrote:
> This works:
> 
> - this is top 1
>       - this is sub 1.1
>       - this is sub 1.2
>         <!-- - going to think about 1.3 for a bit -->
>       - this is sub 1.4
> - this is top 2
>       - this is sub 2.1
>       - this is sub 2.2
>       - this is sub 2.3

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e48f774d-2904-7c9f-1d8f-b21fca3977e8%40reagle.org.


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

* Re: Comments within a list
       [not found]         ` <e48f774d-2904-7c9f-1d8f-b21fca3977e8-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
@ 2021-08-20 21:59           ` John MacFarlane
       [not found]             ` <yh480kmtpbvku5.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2021-08-20 21:59 UTC (permalink / raw)
  To: Joseph Reagle, pandoc-discuss


--strip-comments shouldn't affect this.
Why don't you submit a bug report with a minimal example
showing that it does, and we can look into it.

Joseph Reagle <joseph.2011-T1oY19WcHSwdnm+yROfE0A@public.gmane.org> writes:

> It's the `--strip-comments` option that is causing sibling items around the commented one to be stuck in <p>. I learned of the `--strip-comments` recently and added it as a default to all of my builds -- might as well as keep sleuths from seeing comments to myself. And I just now stubbed my toe on it. Was I mistaken to think this option shouldn't have other side-effects?
>
>
> On 21-08-20 15:52, John MacFarlane wrote:
>> This works:
>> 
>> - this is top 1
>>       - this is sub 1.1
>>       - this is sub 1.2
>>         <!-- - going to think about 1.3 for a bit -->
>>       - this is sub 1.4
>> - this is top 2
>>       - this is sub 2.1
>>       - this is sub 2.2
>>       - this is sub 2.3

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/yh480kmtpbvku5.fsf%40johnmacfarlane.net.


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

* Re: Comments within a list
       [not found]             ` <yh480kmtpbvku5.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2021-08-23 14:03               ` Joseph Reagle
  0 siblings, 0 replies; 9+ messages in thread
From: Joseph Reagle @ 2021-08-23 14:03 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Done: https://github.com/jgm/pandoc/issues/7521

On 21-08-20 17:59, John MacFarlane wrote:
> 
> --strip-comments shouldn't affect this.
> Why don't you submit a bug report with a minimal example
> showing that it does, and we can look into it.
> 
> Joseph Reagle <joseph.2011-T1oY19WcHSwdnm+yROfE0A@public.gmane.org> writes:
> 
>> It's the `--strip-comments` option that is causing sibling items around the commented one to be stuck in <p>. I learned of the `--strip-comments` recently and added it as a default to all of my builds -- might as well as keep sleuths from seeing comments to myself. And I just now stubbed my toe on it. Was I mistaken to think this option shouldn't have other side-effects?
>>
>>
>> On 21-08-20 15:52, John MacFarlane wrote:
>>> This works:
>>>
>>> - this is top 1
>>>        - this is sub 1.1
>>>        - this is sub 1.2
>>>          <!-- - going to think about 1.3 for a bit -->
>>>        - this is sub 1.4
>>> - this is top 2
>>>        - this is sub 2.1
>>>        - this is sub 2.2
>>>        - this is sub 2.3
> 

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/867e0b56-f5fe-2351-5e58-59265529eec2%40reagle.org.


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

end of thread, other threads:[~2021-08-23 14:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 18:11 Comments within a list Joseph Reagle
     [not found] ` <f554871e-a51e-5c58-502d-611a97ca95fd-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
2021-08-20 18:40   ` Daniel Staal
     [not found]     ` <69e1034f-6462-61d9-45f9-3af2c9fd2a97-Jdbf3xiKgS8@public.gmane.org>
2021-08-20 18:55       ` Joseph Reagle
     [not found]         ` <decd3c8a-41f7-bcf2-addf-3e226cfc0896-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
2021-08-20 19:03           ` William Lupton
     [not found]             ` <CAEe_xxg0N37nDD4kD5UfKcJOQM6xfRPVx69cTho=11mhYxWKCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 19:38               ` Joseph Reagle
2021-08-20 19:52   ` John MacFarlane
     [not found]     ` <yh480k35r3x5a1.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-08-20 21:03       ` Joseph Reagle
     [not found]         ` <e48f774d-2904-7c9f-1d8f-b21fca3977e8-T1oY19WcHSwdnm+yROfE0A@public.gmane.org>
2021-08-20 21:59           ` John MacFarlane
     [not found]             ` <yh480kmtpbvku5.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-08-23 14:03               ` Joseph Reagle

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