public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BP Jonsson <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: ANN: pandoc 1.17
Date: Tue, 22 Mar 2016 17:58:04 +0100	[thread overview]
Message-ID: <56F1799C.7070006@gmail.com> (raw)
In-Reply-To: <20160321164605.GA3442-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>

Den 2016-03-21 kl. 17:46, skrev John MacFarlane:
> +++ BP Jonsson [Mar 21 16 14:10 ]:
>
>>>  * Markdown writer: Use hyphens for YAML metadata block bottom
>>> line, for
>>>    better compatibility with other Markdown flavors (Henrik
>>> Tramberend).
>>
>> It also makes it invalid YAML! Which means that you can no

>
> I'm not convinced there's a real practical application where
> having the `...` separator at the end matters.
>
> Do you have an actual existing workflow that breaks because
> of this change?

As it happens I have an application where, while not breaking 
things entirely, the `---` at the end introduces a gotcha in a 
Perl script which calls on pandoc to mirror Markdown files in one 
directory as HTML files in another directory. As part of the 
process the script retrieves the metadata from each Markdown file 
(in order to get the title and build a navigation sidebar) by 
calling pandoc with a template called "yaml.markdown" which contains

     $if(titleblock)$
     $titleblock$
     $else$
     --- {}
     $endif$

and then parses what it gets with a standard YAML tool. What 
happens is, to the best of my knowledge, that because of the 
trailing `---` the YAML parser now sees two YAML documents, the 
second of which is empty, and in scalar context the YAML loading 
function returns the last, empty, document, which happens to be 
returned as an undefined value. Switching to list context 
(`my($meta) = Load $yaml` instead of `my $meta = Load $yaml`) 
removes the need for removing the second 'ghost' document before 
parsing, but it's definitely a gotcha.

While it is not that big a deal it is irritating to now get 
invalid YAML, or rather valid YAML which returns junk, where I 
formerly got valid YAML which could be loaded in list or scalar 
context without further ado.  It is frustrating that pandoc shall 
have to start producing invalid YAML because the rest of the world 
does!


  parent reply	other threads:[~2016-03-22 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-20 17:03 John MacFarlane
     [not found] ` <20160320170353.GA3962-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2016-03-20 18:03   ` John Maxwell
2016-03-21 13:10   ` BP Jonsson
     [not found]     ` <56EFF2BC.30707-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-21 16:46       ` John MacFarlane
     [not found]         ` <20160321164605.GA3442-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2016-03-22 16:58           ` BP Jonsson [this message]
2016-03-21 20:35   ` Fedor Sheremetyev
     [not found]     ` <30E2EE61-380A-4BBD-99F7-CDED707092D1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-21 20:42       ` Jesse Rosenthal
     [not found]         ` <87shzjzhom.fsf-4GNroTWusrE@public.gmane.org>
2016-03-21 21:07           ` Jesse Rosenthal
2016-03-22 15:21   ` Mario Valle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F1799C.7070006@gmail.com \
    --to=bpj-j3h7gcxpsitlodktgw+v6w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).