* question about list item levels in AST
@ 2017-05-26 18:36 Jeff
[not found] ` <87b45790-3706-4bc5-baf6-1329ad75460d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Jeff @ 2017-05-26 18:36 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1087 bytes --]
How does the list item levels get represented in the AST?
Say I issue the command:
$ pandoc -f markdown -t native
* Item 1
* Item 2
* Item 2a
* Item 2b
this is what I got:
[BulletList
[[Plain [Str "Item",Space,Str "1"]]
,[Plain [Str "Item",Space,Str "2"]]
,[Plain [Str "Item",Space,Str "2a"]]
,[Plain [Str "Item",Space,Str "2b"]]]]
It seems to me that in the output AST all four list items are in the same
level, but the markdown text clearly says that item 2a and 2b are a
sublist. Why?
Thanks,
Jeff
--
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/87b45790-3706-4bc5-baf6-1329ad75460d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 1644 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about list item levels in AST
[not found] ` <87b45790-3706-4bc5-baf6-1329ad75460d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-05-26 18:51 ` Jeff
[not found] ` <e5dd7aef-4ee9-4d5a-a572-ddd3eb7d3708-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-05-26 18:59 ` John MacFarlane
1 sibling, 1 reply; 4+ messages in thread
From: Jeff @ 2017-05-26 18:51 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1585 bytes --]
OK I got it. It's all about sufficient indentation.
* Item 1
* Item 1a
gives
[BulletList
[[Plain [Str "Item",Space,Str "1"]]
,[Plain [Str "Item",Space,Str "1a"]]]]
and
* Item 1
* Item 1a
gives
[BulletList
[[Plain [Str "Item",Space,Str "1"]
,BulletList
[[Plain [Str "Item",Space,Str "1a"]]]]]]
As aside, the indentation is spaces or tabs does not seem to matter though.
Jeff
On Friday, 26 May 2017 14:36:17 UTC-4, Jeff wrote:
>
> How does the list item levels get represented in the AST?
>
> Say I issue the command:
> $ pandoc -f markdown -t native
> * Item 1
> * Item 2
> * Item 2a
> * Item 2b
>
> this is what I got:
> [BulletList
> [[Plain [Str "Item",Space,Str "1"]]
> ,[Plain [Str "Item",Space,Str "2"]]
> ,[Plain [Str "Item",Space,Str "2a"]]
> ,[Plain [Str "Item",Space,Str "2b"]]]]
>
> It seems to me that in the output AST all four list items are in the same
> level, but the markdown text clearly says that item 2a and 2b are a
> sublist. Why?
>
> Thanks,
> Jeff
>
--
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/e5dd7aef-4ee9-4d5a-a572-ddd3eb7d3708%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 2427 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about list item levels in AST
[not found] ` <e5dd7aef-4ee9-4d5a-a572-ddd3eb7d3708-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-05-26 18:58 ` Jeff
0 siblings, 0 replies; 4+ messages in thread
From: Jeff @ 2017-05-26 18:58 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1865 bytes --]
By the way, is there a function that, given an input string s whose prefix
is a mixture of space and tabs, outputs the length of total indentaion?
Jeff
On Friday, 26 May 2017 14:51:53 UTC-4, Jeff wrote:
>
> OK I got it. It's all about sufficient indentation.
>
> * Item 1
> * Item 1a
>
> gives
>
> [BulletList
> [[Plain [Str "Item",Space,Str "1"]]
> ,[Plain [Str "Item",Space,Str "1a"]]]]
>
> and
>
> * Item 1
> * Item 1a
>
> gives
>
> [BulletList
> [[Plain [Str "Item",Space,Str "1"]
> ,BulletList
> [[Plain [Str "Item",Space,Str "1a"]]]]]]
>
> As aside, the indentation is spaces or tabs does not seem to matter though.
>
> Jeff
>
> On Friday, 26 May 2017 14:36:17 UTC-4, Jeff wrote:
>>
>> How does the list item levels get represented in the AST?
>>
>> Say I issue the command:
>> $ pandoc -f markdown -t native
>> * Item 1
>> * Item 2
>> * Item 2a
>> * Item 2b
>>
>> this is what I got:
>> [BulletList
>> [[Plain [Str "Item",Space,Str "1"]]
>> ,[Plain [Str "Item",Space,Str "2"]]
>> ,[Plain [Str "Item",Space,Str "2a"]]
>> ,[Plain [Str "Item",Space,Str "2b"]]]]
>>
>> It seems to me that in the output AST all four list items are in the same
>> level, but the markdown text clearly says that item 2a and 2b are a
>> sublist. Why?
>>
>> Thanks,
>> Jeff
>>
>
--
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/82b6b911-ecc1-4e04-907c-38a51f5a1e96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 2789 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about list item levels in AST
[not found] ` <87b45790-3706-4bc5-baf6-1329ad75460d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-05-26 18:51 ` Jeff
@ 2017-05-26 18:59 ` John MacFarlane
1 sibling, 0 replies; 4+ messages in thread
From: John MacFarlane @ 2017-05-26 18:59 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
+++ Jeff [May 26 17 11:36 ]:
> It seems to me that in the output AST all four list items are in the
> same level, but the markdown text clearly says that item 2a and 2b are
> a sublist.
No. You only have two spaces indent, it looks like.
See http://pandoc.org/MANUAL.html#the-four-space-rule
Also issue #3511
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-26 18:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 18:36 question about list item levels in AST Jeff
[not found] ` <87b45790-3706-4bc5-baf6-1329ad75460d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-05-26 18:51 ` Jeff
[not found] ` <e5dd7aef-4ee9-4d5a-a572-ddd3eb7d3708-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-05-26 18:58 ` Jeff
2017-05-26 18:59 ` John MacFarlane
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).