From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28668 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: William Lupton Newsgroups: gmane.text.pandoc Subject: Re: Syntax errors in YAML blocks Date: Mon, 21 Jun 2021 14:43:54 +0100 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e9521c05c546dda6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38233"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBJVPYKDAMGQESJCU7SY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Jun 21 15:44:09 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ed1-f63.google.com ([209.85.208.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lvKDg-0009j0-E4 for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 21 Jun 2021 15:44:08 +0200 Original-Received: by mail-ed1-f63.google.com with SMTP id ee28-20020a056402291cb0290394a9a0bfaesf2333106edb.6 for ; Mon, 21 Jun 2021 06:44:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624283048; cv=pass; d=google.com; s=arc-20160816; b=CEmQDD5vpO328zRqbySfGgfHxkZcymxI33kU7dNtWu3uNX7wvZ6RhdA0jnCITMNzTW 8U/NaRujNiCPh0N1HuWxXcmRXU24BVd7fovWmYNYujOsNaFFetxFddO24qQfbVmqTjkV UQK9oqG8T3o5tJzWgNKBrCn3mJtFAGqjGEdoRivaE+4XfbJfpsCUFnwgBaBRQGSBXiZ8 R50mOttsjGdwc8itSpnb9i+vDX3pTijPJx8Rr36xmj5YWTJrGsm2SYPc38J5BpJCQhtx saO+priUdHohZSjEoXo6S5KfJ7GogIPmMOx9LzELTkzH43tpJlYbje4m9jqotGh9AA6A Qr0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature; bh=1bXNwfaoxztkSACScWhVQWo7OgP2xf9GpW0Y+mwPMSc=; b=CKzzC3ZJsQIrl7QuB6tIHF9vmv449s9Kh/JI/0zhmnUksBJOv15h7iE4c5MI7D4JB9 cKI4CNg4obQgMbYbABE4dqEpfJEcfHk8Ig8t5x4EfWBSXSRWwxGM49da5KYgwTzIfQuZ Yh3HPc1ePD1a/RuDM0iH+KCX+ol8M4CNNOyqqAoogsR26oiUxI0QOJ2OHntp6wtLfqiX q7HgN6ePbtZtNXMsVI5PFq9YB/VdcMEaYwWrYcZwqNppRClJRJl5uSGCMFvuweWU2kBr 3HuqXyvvK5N+vidDJtt+MVmAPAAzKjPTFH6IcTBP9nsniyFuCBIGJBgb3/YPkBB/8ssF VvrA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=RE2pBBQ0; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62b as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=1bXNwfaoxztkSACScWhVQWo7OgP2xf9GpW0Y+mwPMSc=; b=qMvafq52i9acpthZ7hPtlWSzxjQWXxpT0kkY8A11RVG5eaQ7qxFT53dI4UJC7ZkdYN G3lCE0Mu6O8rUg38mHVgFi8hOV2xRJl+FZK9LJrzOvz99gzmRwcnhSLHsTUwu2TarCHi TpjZn5UNjqc1zwPgJunfVCXyU0GgA3FoL/7ZzeG+yyqlMWb1ezrijTenV/ElXQtPhfY3 v/9tieRFSilMSedxa9JLkuENLxaK4VINtIiMQ1t91mbf86n2MddVtaQf88OIuoBvY24s pZZ9LvORLUZaSIQG4X7lElcnEXSTQk4yvEXkdA8A6/njJbwXe9xtvKjIaCL3/xEqaDiz bqeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=1bXNwfaoxztkSACScWhVQWo7OgP2xf9GpW0Y+mwPMSc=; b=sfnR52ZzRkLdsSvNjZFBy9l19h4cvGM4Q5cOonP0Dq6KsUuUk9NcyOSDSAcjSoUdI+ fLH/aIbNLSHUqfbqKiXzux7Ynuf3mVeCWwm0k7SXpPZZS9YZyGAmeX0/OT0/Cs25mjgU 8Sp1CS8ykEJzeWEkWo10CJ6Ikravdfh19VSd6dsnF7WHHnHykGf9xgM57uUMjenSe0WR q/rJO/hGdxPUBbWTKJVD1NGk6EJQGa7y3MORLLlbUISkE1ODNRTHURQFxRlkGjSP92c7 UfATJXUpTCrUybaHnGY1Z/JIpflwfYhplmMzVRsWLy4k2uODE24vxcqbVi7zMYhEBIqy ZD0Q== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533Q0O67iFmcdQigR78xYbVVFoJfvs4M9uI4cqw/oTFnfp/ZLMd2 NcJBTD5xWHagsiiOZk8s3qA= X-Google-Smtp-Source: ABdhPJyWCXRIEcV+rdcB7tCeWCckGkIw66slgxlQS4AJRZaPLMbfpN5e/037+K6ITUlphcnOiEWTYA== X-Received: by 2002:aa7:c3d6:: with SMTP id l22mr13461012edr.245.1624283048060; Mon, 21 Jun 2021 06:44:08 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6402:4404:: with SMTP id y4ls1463876eda.1.gmail; Mon, 21 Jun 2021 06:44:05 -0700 (PDT) X-Received: by 2002:aa7:d74d:: with SMTP id a13mr21856224eds.43.1624283045514; Mon, 21 Jun 2021 06:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624283045; cv=none; d=google.com; s=arc-20160816; b=XP97sG1kh5JGbAVd50KEbNWrM7tsV99kRhtZa1QsijSRg2hyPnBz1zqf2Hx6BYDzhJ 0hECn3N2OFy7S2EWxMTrW2YbNrHWly2yY/kdY3tazn9dlhgwkiNU/A9acqwogCP4cpWY yc+jK/JvlWW5JzrFGwHkw72I9i0V21qY8QZ+utbbdUql5xBcXDrz5Qvdv7cc0+PycRf2 rM56KCc6PBDcICSSLvwjHkvmtpJeuY2d51PJzw+0Tkjq4JvUToi7KyiPKBrQoWidOQBi mgbqYKSkNXGZusSq6VtiI3XBrK3prO0KMnnuBdQAelxl9CmWFOWLqrdkcuomHwGAxck7 Tapw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=uMlcjfsficxxzQT4zRqZe3svhWkuU6Afy2RRTd55vTA=; b=GWEZYWwviYOm0mbL5XLjWzkIilIJw+HWBxAxNJRK/RYV/9PKR4U0kM/bsIryaCYt/W upp/pugM8BdSDGOoknONv5xcpNZ5IqC1K8YHX750S9Z5dkLu39fJCUIHxYnnEwoTDARB FocGrXwqZJwlAlMN1doXxn2aFMK0B5Cf17H/UZDjaDA6btYo0HeMCzG1m/Ykz42qB/RA 1UNzBQaZINcRojLSBjMbRREi4mirJh0klOFYrv/Xynaj5edukWutJQ/ll7U5Wa4El4ef Ev0IApaRshwj3SHQcuefQ5GWfEvxDieaFKCKTRqdEfoCjuyEMk8S+cwblHn7JlOxfXDL Z2Dg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=RE2pBBQ0; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62b as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org Original-Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com. [2a00:1450:4864:20::62b]) by gmr-mx.google.com with ESMTPS id e26si753967edr.3.2021.06.21.06.44.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Jun 2021 06:44:05 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62b as permitted sender) client-ip=2a00:1450:4864:20::62b; Original-Received: by mail-ej1-x62b.google.com with SMTP id hq39so1858123ejc.5 for ; Mon, 21 Jun 2021 06:44:05 -0700 (PDT) X-Received: by 2002:a17:906:d116:: with SMTP id b22mr15601483ejz.540.1624283044985; Mon, 21 Jun 2021 06:44:04 -0700 (PDT) In-Reply-To: X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=RE2pBBQ0; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62b as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:28668 Archived-At: --000000000000e9521c05c546dda6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable All, I don't know how I missed this before, but I have noticed that this isn't treated as a valid YAML block (at least not with pandoc 2.11.4). *% *cat comment.md --- # comment ... *% *pandoc comment.md

comment

=E2=80=A6

Inserting some YAML works: *% *cat comment-plus-variable.md --- # comment variable: 42 ... *% *pandoc comment-plus-variable.md I realise that this is an abuse, and that I could have used an HTML comment (for example), but I believe that this is valid YAML, so should it have worked? *% *yq eval comment.md # comment *% *yq eval comment-plus-variable.md # comment variable: 42 Apologies if this behaviour has changed in the latest pandoc... Thanks, William On Thu, 3 Jun 2021 at 09:10, William Lupton wrote: > Thanks! > > On Thu, 3 Jun 2021 at 05:49, John MacFarlane wrote: > >> >> These are good suggestions. I've revised the manual accordingly. >> >> BPJ writes: >> >> > Perhaps it should be pointed out that the body of YAML block scalars >> must >> > be indented relative to the line with the `|` or `>`. Not doing so is >> > indeed a YAML syntax error, so Pandoc does the right thing when not >> > considering it valid YAML, however unfortunate it is that Pandoc may >> think >> > it is something else. >> > >> > The overview of YAML syntax on Wikipedia is quite good. Perhaps the >> manual >> > could link to (some specific version of) it. >> > >> > https://en.m.wikipedia.org/wiki/YAML#Syntax >> > >> > Den ons 2 juni 2021 21:21John MacFarlane skrev: >> > >> >> >> >> The problem is that basically anything is valid Markdown, >> >> it's just a matter of how it is interpreted. It does seem >> >> to me that in the second case we might want to at least emit >> >> a warning -- if not downright fail. It's just so unlikely >> >> that someone would write a block beginning with `---` >> >> and ending with `...` and intend it to be something other >> >> than YAML metadata. If you'd like, you could submit an >> >> issue for this. I'd rather not suggest avoiding complex >> >> YAML blocks -- sometimes they're fine, if the syntax is >> >> correct! >> >> >> >> William Lupton writes: >> >> >> >> > Thanks. Yes, I guess I realised it had something to do with ambiguo= us >> >> > grammars, but I hadn't really considered that my input was a valid >> table >> >> > (mea culpa). >> >> > >> >> > So I thought aha! I'll change the terminating "---" to "..." (in th= e >> hope >> >> > of an error), but this of course gives the output shown below. >> >> > >> >> > I wonder whether there could be a warning in the manual (or maybe >> there >> >> is >> >> > and I've missed it?) and/or perhaps a suggestion that it might be a >> good >> >> > idea to avoid complex YAML metadata blocks (in favour of metadata >> files)? >> >> > I'd be happy to create an issue and/or a MANUAL.md pull request. >> >> > >> >> > % cat bad.md >> >> > --- >> >> > history: >> >> > - number: Release 1.2 >> >> > changes: | >> >> > - TBD >> >> > ... >> >> > >> >> > % pandoc bad.md >> >> >
>> >> >

history: - number: Release 1.2 changes: | - TBD =E2=80=A6

>> >> > >> >> > >> >> > On Wed, 2 Jun 2021 at 17:47, John MacFarlane >> wrote: >> >> > >> >> >> >> >> >> Well, this actually IS a valid "simple table". So how is >> >> >> pandoc to know that you intended it as a YAML metadata block? >> >> >> Pandoc tries first to parse things as YAML blocks, and then as >> >> >> tables, if either works, the parse succeeds with no error. >> >> >> >> >> >> William Lupton writes: >> >> >> >> >> >> > Should I expect syntax errors in YAML blocks to be detected and >> >> reported? >> >> >> > >> >> >> > This has a syntax error in the YAML block: >> >> >> > >> >> >> > % cat bad.md >> >> >> > --- >> >> >> > history: >> >> >> > - number: Release 1.2 >> >> >> > changes: | >> >> >> > - TBD >> >> >> > --- >> >> >> > >> >> >> > This fixes it: >> >> >> > >> >> >> > % diff bad.md good.md >> >> >> > 5c5 >> >> >> > < - TBD >> >> >> > --- >> >> >> >> - TBD >> >> >> > >> >> >> > The latest pandoc: >> >> >> > >> >> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc -v >> >> >> > pandoc 2.14.0.1 >> >> >> > ... >> >> >> > >> >> >> > Pandoc thinks the bad YAML is a table: >> >> >> > >> >> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc bad.md >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> >
history:
- number: Release 1.2
changes: |
- TBD
>> >> >> > >> >> >> > But it's OK with the good YAML: >> >> >> > >> >> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc good.md >> >> >> > >> >> >> > Parsing the file as YAML reports the error: >> >> >> > >> >> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc --metadata-file bad.md >> >> >> > Error at "bad.md" (line 5, column 0): >> >> >> > Unexpected ' ' >> >> >> > >> >> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc --metadata-file good.md >> >> >> > ^C >> >> >> > >> >> >> > -- >> >> >> > You received this message because you are subscribed to the Goog= le >> >> >> 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_xxjF3Un2J-xg5UOs7u= ReZ5cO27TATA%2BfDY%2BAtghAsVhShA%40mail.gmail.com >> >> >> . >> >> >> >> >> >> >> -- >> >> 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, sen= d >> 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/m2a6o8ul91.fsf%40johnma= cfarlane.net >> >> . >> >> >> > >> > -- >> > 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/CADAJKhC2g4z_H%2BK%2BVt= GoVd1T2nmYeMuRrnUquhDPpoYfuxSwWw%40mail.gmail.com >> . >> > --=20 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 e= mail 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_xxj-bHpfTLDhz5QRz51x-zcs%2BVW5dgWbmRTRaNL%2Bx6Y31Q%40ma= il.gmail.com. --000000000000e9521c05c546dda6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
All,

I don't know how I missed this before, but I have noticed that this is= n't treated as a valid YAML block (at least not with pandoc 2.11.4).

% cat comment.md=C2=A0

---

# comment

...


% pandoc comment.md=C2=A0

<hr />

<h1 id=3D"comment">comment</h1>

<p>=E2=80=A6</p>


<= div>Inserting some YAML works:

% cat comment-plus-variable.m= d=C2=A0

---

# comment

variable: 42

...


% pandoc comment-plus-variabl= e.md=C2=A0



I realise that = this is an abuse, and that I could have used an HTML comment (for example),= but I believe that this is valid YAML, so should it have worked?

<= /div>

% yq eval comment.md



# comment



% yq eval comment-plus-variab= le.md

# comment

variable: 42


Apologies if this behaviour ha= s changed in the latest pandoc...

=
Thanks,
William

On Thu, 3 Jun 2021 at 09:10, William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> wro= te:
Thanks!=C2=A0

On Thu, 3 Jun 2021 at 05:49, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> = wrote:

These are good suggestions.=C2=A0 I've revised the manual accordingly.<= br>
BPJ <melroch@gmai= l.com> writes:

> Perhaps it should be pointed out that the body of YAML block scalars m= ust
> be indented relative to the line with the `|` or `>`. Not doing so = is
> indeed a YAML syntax error, so Pandoc does the right thing when not > considering it valid YAML, however unfortunate it is that Pandoc may t= hink
> it is something else.
>
> The overview of YAML syntax on Wikipedia is quite good. Perhaps the ma= nual
> could link to (some specific version of) it.
>
> https://en.m.wikipedia.org/wiki/YAML#Syntax
>
> Den ons 2 juni 2021 21:21John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> skrev:
>
>>
>> The problem is that basically anything is valid Markdown,
>> it's just a matter of how it is interpreted.=C2=A0 It does see= m
>> to me that in the second case we might want to at least emit
>> a warning -- if not downright fail.=C2=A0 It's just so unlikel= y
>> that someone would write a block beginning with `---`
>> and ending with `...` and intend it to be something other
>> than YAML metadata.=C2=A0 If you'd like, you could submit an >> issue for this.=C2=A0 I'd rather not suggest avoiding complex<= br> >> YAML blocks -- sometimes they're fine, if the syntax is
>> correct!
>>
>> William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> writes:
>>
>> > Thanks. Yes, I guess I realised it had something to do with a= mbiguous
>> > grammars, but I hadn't really considered that my input wa= s a valid table
>> > (mea culpa).
>> >
>> > So I thought aha! I'll change the terminating "---&q= uot; to "..." (in the hope
>> > of an error), but this of course gives the output shown below= .
>> >
>> > I wonder whether there could be a warning in the manual (or m= aybe there
>> is
>> > and I've missed it?) and/or perhaps a suggestion that it = might be a good
>> > idea to avoid complex YAML metadata blocks (in favour of meta= data files)?
>> > I'd be happy to create an issue and/or a MANUAL.md pull r= equest.
>> >
>> > % cat bad.md
>> > ---
>> > history:
>> > - number: Release 1.2
>> >=C2=A0 =C2=A0changes: |
>> >=C2=A0 =C2=A0- TBD
>> > ...
>> >
>> > % pandoc bad.md
>> > <hr />
>> > <p>history: - number: Release 1.2 changes: | - TBD =E2= =80=A6</p>
>> >
>> >
>> > On Wed, 2 Jun 2021 at 17:47, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote: >> >
>> >>
>> >> Well, this actually IS a valid "simple table".= =C2=A0 So how is
>> >> pandoc to know that you intended it as a YAML metadata bl= ock?
>> >> Pandoc tries first to parse things as YAML blocks, and th= en as
>> >> tables, if either works, the parse succeeds with no error= .
>> >>
>> >> William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> writes:
>> >>
>> >> > Should I expect syntax errors in YAML blocks to be d= etected and
>> reported?
>> >> >
>> >> > This has a syntax error in the YAML block:
>> >> >
>> >> > % cat bad.md
>> >> > ---
>> >> > history:
>> >> > - number: Release 1.2
>> >> >=C2=A0 =C2=A0changes: |
>> >> >=C2=A0 =C2=A0- TBD
>> >> > ---
>> >> >
>> >> > This fixes it:
>> >> >
>> >> > % diff bad.md good.md
>> >> > 5c5
>> >> > <=C2=A0 =C2=A0- TBD
>> >> > ---
>> >> >>=C2=A0 =C2=A0 =C2=A0- TBD
>> >> >
>> >> > The latest pandoc:
>> >> >
>> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc -v
>> >> > pandoc 2.14.0.1
>> >> > ...
>> >> >
>> >> > Pandoc thinks the bad YAML is a table:
>> >> >
>> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc bad.md
>> >> > <table>
>> >> > <tbody>
>> >> > <tr class=3D"odd">
>> >> > <td>history:</td>
>> >> > </tr>
>> >> > <tr class=3D"even">
>> >> > <td>- number: Release 1.2</td>
>> >> > </tr>
>> >> > <tr class=3D"odd">
>> >> > <td>changes: |</td>
>> >> > </tr>
>> >> > <tr class=3D"even">
>> >> > <td>- TBD</td>
>> >> > </tr>
>> >> > </tbody>
>> >> > </table>
>> >> >
>> >> > But it's OK with the good YAML:
>> >> >
>> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc good.md
>> >> >
>> >> > Parsing the file as YAML reports the error:
>> >> >
>> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc --metadata-= file bad.md
>> >> > Error at "bad.md" (line 5, column 0):
>> >> > Unexpected ' '
>> >> >
>> >> > % ~/Downloads/pandoc-2.14.0.1/bin/pandoc --metadata-= file good.md
>> >> > ^C
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed= to the Google
>> >> Groups "pandoc-discuss" group.
>> >> > To unsubscribe from this group and stop receiving em= ails from it, send
>> >> an email to pandoc-discuss+unsubscribe@googlegrou= ps.com.
>> >> > To view this discussion on the web visit
>> >>
>> https://groups.google.com/d/msgid/pandoc-disc= uss/CAEe_xxjF3Un2J-xg5UOs7uReZ5cO27TATA%2BfDY%2BAtghAsVhShA%40mail.gmail.co= m
>> >> .
>> >>
>>
>> --
>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.<= br> >> To view this discussion on the web visit
>> https:/= /groups.google.com/d/msgid/pandoc-discuss/m2a6o8ul91.fsf%40johnmacfarlane.n= et
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Gro= ups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://= groups.google.com/d/msgid/pandoc-discuss/CADAJKhC2g4z_H%2BK%2BVtGoVd1T2nmYe= MuRrnUquhDPpoYfuxSwWw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://gro= ups.google.com/d/msgid/pandoc-discuss/CAEe_xxj-bHpfTLDhz5QRz51x-zcs%2BVW5dg= WbmRTRaNL%2Bx6Y31Q%40mail.gmail.com.
--000000000000e9521c05c546dda6--