public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Syntax errors in YAML blocks
@ 2021-06-02 13:42 William Lupton
       [not found] ` <CAEe_xxjF3Un2J-xg5UOs7uReZ5cO27TATA+fDY+AtghAsVhShA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: William Lupton @ 2021-06-02 13:42 UTC (permalink / raw)
  To: pandoc-discuss

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

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
<table>
<tbody>
<tr class="odd">
<td>history:</td>
</tr>
<tr class="even">
<td>- number: Release 1.2</td>
</tr>
<tr class="odd">
<td>changes: |</td>
</tr>
<tr class="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 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-xg5UOs7uReZ5cO27TATA%2BfDY%2BAtghAsVhShA%40mail.gmail.com.

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

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

end of thread, other threads:[~2021-06-22 17:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 13:42 Syntax errors in YAML blocks William Lupton
     [not found] ` <CAEe_xxjF3Un2J-xg5UOs7uReZ5cO27TATA+fDY+AtghAsVhShA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-02 16:46   ` John MacFarlane
     [not found]     ` <m2o8cousce.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-06-02 17:09       ` William Lupton
     [not found]         ` <CAEe_xxiHXF5vQTwyoUVLErHXSb+iMQvUaodU3aPbjnJ=fT54dQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-02 19:20           ` John MacFarlane
     [not found]             ` <m2a6o8ul91.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-06-02 19:52               ` BPJ
     [not found]                 ` <CADAJKhC2g4z_H+K+VtGoVd1T2nmYeMuRrnUquhDPpoYfuxSwWw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-03  4:49                   ` John MacFarlane
     [not found]                     ` <m21r9jv9gv.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-06-03  8:10                       ` William Lupton
     [not found]                         ` <CAEe_xxgTz6jLbWSK1t6Ln_xgr=LDk9XUDbomQH6nWvvTRQVC3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-21 13:43                           ` William Lupton
     [not found]                             ` <CAEe_xxj-bHpfTLDhz5QRz51x-zcs+VW5dgWbmRTRaNL+x6Y31Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-21 14:36                               ` BPJ
     [not found]                                 ` <CADAJKhAr3Q_FR8FaubSDUxj692uSwAhKgdVV8mDRw5eU7HmO0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-21 22:00                                   ` John MacFarlane
     [not found]                                     ` <m27dimg9nv.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-06-22  9:26                                       ` William Lupton
     [not found]                                         ` <CAEe_xxh-geLJmwn4cuYftHAVzA6UZKq9wUkE7s5hPvsUw88=Ew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-22 16:56                                           ` John MacFarlane
     [not found]                                             ` <m27dilon28.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-06-22 17:03                                               ` William Lupton

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