public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Numbers as YAML keys broken?
@ 2018-07-30 20:46 BP Jonsson
       [not found] ` <086ac3f4-dbe0-6df2-04cb-b98dc9bce32f-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: BP Jonsson @ 2018-07-30 20:46 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

(I'm resending this as it seems it didn't get through.)

It seems like pandoc 2.2.2.1 thinks that a metadata block with 
numbers as
mapping keys is a table. If I quote the keys/numbers it seems to 
work OK.
Is this really as it's supposed to be? AFAIK the YAML 1.2 spec doesn't
mention any such restriction.

Please see the three example inputs and outputs below.
The second one displays the problem.

/bpj

```
IN
---
foo: bar
baz:
   biz: buz
---

Quux.
OUT
<p>Quux.</p>
IN
---
0: bar
1:
   2: buz
---

Quux.
OUT
<table>
<tbody>
<tr class="odd">
<td>0: bar</td>
</tr>
<tr class="even">
<td>1:</td>
</tr>
<tr class="odd">
<td>2: buz</td>
</tr>
</tbody>
</table>
<p>Quux.</p>
IN
---
'0': bar
'1':
   '2': buz
---

Quux.
OUT
<p>Quux.</p>
```


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

* Re: Numbers as YAML keys broken?
       [not found] ` <086ac3f4-dbe0-6df2-04cb-b98dc9bce32f-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-07-30 23:44   ` John MacFarlane
       [not found]     ` <yh480ksh4070hk.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2018-07-30 23:44 UTC (permalink / raw)
  To: BP Jonsson, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


We switched to a pure Haskell YAML parser that
implements YAML 1.2, and a few things are different.
I noted in the release notes some changes in booleans,
and this appears to be another example. Just quoting
the numbers will work:

---
'0': bar
---

The HsYAML author says that there are some settings in
HsYAML that we could fiddle with to make this quoting
unnecessary. I need to look into this. If you want,
you can submit something on the issue tracker.

BP Jonsson <bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> (I'm resending this as it seems it didn't get through.)
>
> It seems like pandoc 2.2.2.1 thinks that a metadata block with 
> numbers as
> mapping keys is a table. If I quote the keys/numbers it seems to 
> work OK.
> Is this really as it's supposed to be? AFAIK the YAML 1.2 spec doesn't
> mention any such restriction.
>
> Please see the three example inputs and outputs below.
> The second one displays the problem.
>
> /bpj
>
> ```
> IN
> ---
> foo: bar
> baz:
>    biz: buz
> ---
>
> Quux.
> OUT
> <p>Quux.</p>
> IN
> ---
> 0: bar
> 1:
>    2: buz
> ---
>
> Quux.
> OUT
> <table>
> <tbody>
> <tr class="odd">
> <td>0: bar</td>
> </tr>
> <tr class="even">
> <td>1:</td>
> </tr>
> <tr class="odd">
> <td>2: buz</td>
> </tr>
> </tbody>
> </table>
> <p>Quux.</p>
> IN
> ---
> '0': bar
> '1':
>    '2': buz
> ---
>
> Quux.
> OUT
> <p>Quux.</p>
> ```
>
> -- 
> 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/086ac3f4-dbe0-6df2-04cb-b98dc9bce32f%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.


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

* Re: Numbers as YAML keys broken?
       [not found]     ` <yh480ksh4070hk.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2018-07-31  6:08       ` John MacFarlane
       [not found]         ` <m2wotcvsxp.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2018-07-31  6:08 UTC (permalink / raw)
  To: BP Jonsson, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Just pushed d3d932f42cd361a7b4d7e2b22a3238f53cb54f6b
which should fix this and allow unquoted numbers as
YAML keys.

John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:

> We switched to a pure Haskell YAML parser that
> implements YAML 1.2, and a few things are different.
> I noted in the release notes some changes in booleans,
> and this appears to be another example. Just quoting
> the numbers will work:
>
> ---
> '0': bar
> ---
>
> The HsYAML author says that there are some settings in
> HsYAML that we could fiddle with to make this quoting
> unnecessary. I need to look into this. If you want,
> you can submit something on the issue tracker.
>
> BP Jonsson <bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> (I'm resending this as it seems it didn't get through.)
>>
>> It seems like pandoc 2.2.2.1 thinks that a metadata block with 
>> numbers as
>> mapping keys is a table. If I quote the keys/numbers it seems to 
>> work OK.
>> Is this really as it's supposed to be? AFAIK the YAML 1.2 spec doesn't
>> mention any such restriction.
>>
>> Please see the three example inputs and outputs below.
>> The second one displays the problem.
>>
>> /bpj
>>
>> ```
>> IN
>> ---
>> foo: bar
>> baz:
>>    biz: buz
>> ---
>>
>> Quux.
>> OUT
>> <p>Quux.</p>
>> IN
>> ---
>> 0: bar
>> 1:
>>    2: buz
>> ---
>>
>> Quux.
>> OUT
>> <table>
>> <tbody>
>> <tr class="odd">
>> <td>0: bar</td>
>> </tr>
>> <tr class="even">
>> <td>1:</td>
>> </tr>
>> <tr class="odd">
>> <td>2: buz</td>
>> </tr>
>> </tbody>
>> </table>
>> <p>Quux.</p>
>> IN
>> ---
>> '0': bar
>> '1':
>>    '2': buz
>> ---
>>
>> Quux.
>> OUT
>> <p>Quux.</p>
>> ```
>>
>> -- 
>> 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/086ac3f4-dbe0-6df2-04cb-b98dc9bce32f%40gmail.com.
>> For more options, visit 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/yh480ksh4070hk.fsf%40johnmacfarlane.net.
> For more options, visit https://groups.google.com/d/optout.


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

* Re: Numbers as YAML keys broken?
       [not found]         ` <m2wotcvsxp.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2018-07-31  8:37           ` BP Jonsson
  0 siblings, 0 replies; 5+ messages in thread
From: BP Jonsson @ 2018-07-31  8:37 UTC (permalink / raw)
  Cc: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Thanks!


tis 31 juli 2018 kl. 08:08 skrev John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

>
> Just pushed d3d932f42cd361a7b4d7e2b22a3238f53cb54f6b
> which should fix this and allow unquoted numbers as
> YAML keys.
>
> John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:
>
> > We switched to a pure Haskell YAML parser that
> > implements YAML 1.2, and a few things are different.
> > I noted in the release notes some changes in booleans,
> > and this appears to be another example. Just quoting
> > the numbers will work:
> >
> > ---
> > '0': bar
> > ---
> >
> > The HsYAML author says that there are some settings in
> > HsYAML that we could fiddle with to make this quoting
> > unnecessary. I need to look into this. If you want,
> > you can submit something on the issue tracker.
> >
> > BP Jonsson <bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> >
> >> (I'm resending this as it seems it didn't get through.)
> >>
> >> It seems like pandoc 2.2.2.1 thinks that a metadata block with
> >> numbers as
> >> mapping keys is a table. If I quote the keys/numbers it seems to
> >> work OK.
> >> Is this really as it's supposed to be? AFAIK the YAML 1.2 spec doesn't
> >> mention any such restriction.
> >>
> >> Please see the three example inputs and outputs below.
> >> The second one displays the problem.
> >>
> >> /bpj
> >>
> >> ```
> >> IN
> >> ---
> >> foo: bar
> >> baz:
> >>    biz: buz
> >> ---
> >>
> >> Quux.
> >> OUT
> >> <p>Quux.</p>
> >> IN
> >> ---
> >> 0: bar
> >> 1:
> >>    2: buz
> >> ---
> >>
> >> Quux.
> >> OUT
> >> <table>
> >> <tbody>
> >> <tr class="odd">
> >> <td>0: bar</td>
> >> </tr>
> >> <tr class="even">
> >> <td>1:</td>
> >> </tr>
> >> <tr class="odd">
> >> <td>2: buz</td>
> >> </tr>
> >> </tbody>
> >> </table>
> >> <p>Quux.</p>
> >> IN
> >> ---
> >> '0': bar
> >> '1':
> >>    '2': buz
> >> ---
> >>
> >> Quux.
> >> OUT
> >> <p>Quux.</p>
> >> ```
> >>
> >> --
> >> 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/086ac3f4-dbe0-6df2-04cb-b98dc9bce32f%40gmail.com
> .
> >> For more options, visit 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/yh480ksh4070hk.fsf%40johnmacfarlane.net
> .
> > For more options, visit https://groups.google.com/d/optout.
>
-- 

------------------------------
SavedURI :Show URLShow URLSavedURI :
SavedURI :Hide URLHide URLSavedURI :
https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.sv.G3GZFwvcniQ.O/m=m_i,t,it/am=fUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=h/d=1/rs=AItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvwhttps://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.sv.G3GZFwvcniQ.O/m=m_i,t,it/am=fUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=h/d=1/rs=AItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvw
<https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.sv.G3GZFwvcniQ.O/m=m_i,t,it/am=fUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=h/d=1/rs=AItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvw>
<https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.sv.G3GZFwvcniQ.O/m=m_i,t,it/am=fUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=h/d=1/rs=AItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvw>
------------------------------

-- 
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/CAFC_yuS%3DW7XnFKoqHdi0fCgtMRnuEN5se-Znrhaa9UhDaR%2ByOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Numbers as YAML keys broken?
@ 2018-07-30 20:12 BP Jonsson
  0 siblings, 0 replies; 5+ messages in thread
From: BP Jonsson @ 2018-07-30 20:12 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

It seems like pandoc 2.2.2.1 thinks that a metadata block with 
numbers as
mapping keys is a table. If I quote the keys/numbers it seems to 
work OK.
Is this really as it's supposed to be? AFAIK the YAML 1.2 spec doesn't
mention any such restriction.

Please see the three example inputs and outputs below.
The second one displays the problem.

/bpj

```
IN
---
foo: bar
baz:
   biz: buz
---

Quux.
OUT
<p>Quux.</p>
IN
---
0: bar
1:
   2: buz
---

Quux.
OUT
<table>
<tbody>
<tr class="odd">
<td>0: bar</td>
</tr>
<tr class="even">
<td>1:</td>
</tr>
<tr class="odd">
<td>2: buz</td>
</tr>
</tbody>
</table>
<p>Quux.</p>
IN
---
'0': bar
'1':
   '2': buz
---

Quux.
OUT
<p>Quux.</p>
```


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

end of thread, other threads:[~2018-07-31  8:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-30 20:46 Numbers as YAML keys broken? BP Jonsson
     [not found] ` <086ac3f4-dbe0-6df2-04cb-b98dc9bce32f-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-07-30 23:44   ` John MacFarlane
     [not found]     ` <yh480ksh4070hk.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-07-31  6:08       ` John MacFarlane
     [not found]         ` <m2wotcvsxp.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-07-31  8:37           ` BP Jonsson
  -- strict thread matches above, loose matches on Subject: below --
2018-07-30 20:12 BP Jonsson

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