From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: YAML closing delimiter
Date: Tue, 20 Oct 2015 21:04:48 -0700 [thread overview]
Message-ID: <20151021040448.GA64292@MacBook-Air.local> (raw)
In-Reply-To: <5624AEDA.9050903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
+++ BP Jonsson [Oct 19 15 10:50 ]:
>Den 2015-10-19 kl. 07:12, skrev John MacFarlane:
>>+++ BPJ [Oct 18 15 10:58 ]:
>>> Try
>>>
>>> pandoc -t markdown [1]in.md | perl -ple's/^\.\.\.$/---/' >out.md
>>
>>This will probably work well enough in most cases, but what
>>if your document has a line with `...` that isn't a YAML
>>header closer? (E.g. in a fenced code block?) It will get
>>converted to `---` too, won't it?
>>
>
>I thought the same right after I hit send. There is a trick which will
>replace only the first match in the file, which is usually what you
>want in this case:
>
> pandoc -t markdown in.md | perl -ple'$seen ||= s/^\.\.\.$/---/' >>out.md
Thanks for that. I puzzled for some time trying to figure
out how to do this! Seems like it ought to be simpler.
next prev parent reply other threads:[~2015-10-21 4:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 16:11 John Muccigrosso
[not found] ` <ebb2d862-397d-4e25-9e7e-fb54323a81c2-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-10-13 18:09 ` John MACFARLANE
[not found] ` <20151013180944.GB6891-4kKid1p5UN4xFjuZnxJpBp3lxR28IOakuDuwTybUTCk@public.gmane.org>
2015-10-13 20:54 ` John Muccigrosso
[not found] ` <08e65baa-f8d6-4437-af61-d106b36d1382-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-10-18 8:58 ` BPJ
[not found] ` <CADAJKhCt9EqV_v3XTrXq=oPFiOHnEsk5xEtB8wYiMKb3V0xDTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-19 5:12 ` John MacFarlane
[not found] ` <20151019051220.GA15885-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
2015-10-19 8:50 ` BP Jonsson
[not found] ` <5624AEDA.9050903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-21 4:04 ` John MacFarlane [this message]
2015-10-18 18:39 ` John Muccigrosso
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=20151021040448.GA64292@MacBook-Air.local \
--to=jgm-tvlzxgkolnx2fbvcvol8/a@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).