public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Corner case: Bullet list item starting with number with period
@ 2021-09-08 10:07 krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
       [not found] ` <35cb746c-1ee8-4fd4-b7fb-753caa8c5e1dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org @ 2021-09-08 10:07 UTC (permalink / raw)
  To: pandoc-discuss


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

Recently I have hit upon a corner case which (I guess) wasnt probably 
thought off. If you have bullet list item like so:

```{org}
- 11. and 12. 09. meeting
```

converting to pandoc AST yields (ran in Try pandoc):

```{native}
[BulletList [[OrderedList (1,DefaultStyle,DefaultDelim) [[Plain [Str 
"and",Space,Str "12.",Space,Str "09.",Space,Str "meeting"]]]]]] 
```

removing first number.

Running this:

```{org}
- 11. 09. meeting
```

removes even more:

```{native}
[BulletList [[OrderedList (1,DefaultStyle,DefaultDelim) [[OrderedList 
(1,DefaultStyle,DefaultDelim) [[Plain [Str "meeting"]]]]]]]] 
```

Meaning removes all numbers, whitespace, periods until alphabetic letters.

Markdown conversion acts a little differently -- anything that seems as a 
start of ordered list is interpreted as such:

```{md}
- 11. 09. meeting
```

produces:

```{native}
[BulletList [[OrderedList (11,Decimal,Period) [[OrderedList 
(9,Decimal,Period) [[Plain [Str "meeting"]]]]]]]] 
```

and 

```{md}
- 11. and 12. 09. meeting
```

produces:

```{native} 
[BulletList [[OrderedList (11,Decimal,Period) [[Plain [Str "and",Space,Str 
"12.",Space,Str "09.",Space,Str "meeting"]]]]]]
```

I guess that pandoc is making a pretty sensible assumption that all those 
numbers ending with period are starting new ordered list from different 
number than 1. But that breaks when using dates in start of a bullet list 
item.

As far as I know pandoc doesnt have a "date" element, and I also think it 
doesnt need one.

As proposed solution I think that another check in readers should be made 
that all text after bullet mark should be considered regular text, until a 
linebreak; or 2 linebreaks with text starting in column 2 (for items 
spanning more than one paragraph).

I have hit upon this when converting Org mode to docx, in where the first 
number is actually left off totally, so:

```{org}
- 11. and 12. 09. meeting
```

results in:

```{docx}
- and 12. 09. meeting
```

Which in my opinion is bug in all instances. If it would render ordered 
list in bullet list (as it should with):

```{native} 
[BulletList [[OrderedList (11,Decimal,Period) [[Plain [Str "and",Space,Str 
"12.",Space,Str "09.",Space,Str "meeting"]]]]]]
```

it would be easier to notice, at least.

Can this corner case be resolved better? Should I make this a github issue?

-- 
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/35cb746c-1ee8-4fd4-b7fb-753caa8c5e1dn%40googlegroups.com.

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

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

end of thread, other threads:[~2021-09-09  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 10:07 Corner case: Bullet list item starting with number with period krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found] ` <35cb746c-1ee8-4fd4-b7fb-753caa8c5e1dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-09-08 16:58   ` John MacFarlane
     [not found]     ` <m2ilzb2ed7.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-09-09  9:15       ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

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