From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/13758 Path: news.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: YAML closing delimiter Date: Tue, 20 Oct 2015 21:04:48 -0700 Message-ID: <20151021040448.GA64292@MacBook-Air.local> References: <20151013180944.GB6891@D25Q40BGFY13.Berkeley.EDU> <08e65baa-f8d6-4437-af61-d106b36d1382@googlegroups.com> <20151019051220.GA15885@protagoras.berkeley.edu> <5624AEDA.9050903@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed X-Trace: ger.gmane.org 1445400325 19580 80.91.229.3 (21 Oct 2015 04:05:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Oct 2015 04:05:25 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBB3U5TSYQKGQEZLAZSVA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Oct 21 06:05:12 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yk0-f189.google.com ([209.85.160.189]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZokeC-0003Gu-Mv for gtp-pandoc-discuss@m.gmane.org; Wed, 21 Oct 2015 06:05:08 +0200 Original-Received: by ykba4 with SMTP id a4sf7157104ykb.0 for ; Tue, 20 Oct 2015 21:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=from:date:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :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:sender:list-subscribe:list-unsubscribe; bh=EzpCZziVFRFHTKgIAYvfxANKXt/GpYKrYMK9E9aJjsE=; b=p9LbRRtNceN/SdwGO7A4Li/8N5YUEirVilfZU7Z5Jh7O5pffrJ5NDxMFW0Q8itfQKU KgCr2AsMrH3uz71z5hIuXN8sLdBJzgSHDfk9rduYPSbt8RKy3cx+eWZZ4t8lR1katLvD lm7bKwG+FawAXCbrh9MCkwq+78dT325QJRCwL7sYum0NNtikEqNVGtjpj1ge1fvK1HCu /fiRGpPaMUDB3ASstxbclN+6aPOWQNaOgdx1Cc0hhJWwHCYbS4UH61VfvhjD2oSw/9zY xU7FCmlhA9alHqG+zPzrqRLnf/A5jW+fe0xH1ULVBSX8bNSP7jnUPk/G/cvl86FQ4qgO X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent: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:sender:list-subscribe :list-unsubscribe; bh=EzpCZziVFRFHTKgIAYvfxANKXt/GpYKrYMK9E9aJjsE=; b=NGci2c+s181sjG5U1DReGgxxLpCcsh04BAtuiD7o47fOPYHH+R/lYKTcWGKugQ8IJ+ a0ZAWcTqKsLjX/E/PannuF8Tm5dNnGInbJKoyKQROzfjCStAo2noGCdgKz0ICbmv6wXY tOpvlGffIey3iM6juJUfrHgGWcO4vxj8kN9qiRUhPP0Ry0F+58lzHRYMgZd7qF93N7KO nRSdVYND/E2TZ84nzq+T7te9LNxJyHuLNeAqSrN+qLppWEjm2V9T/a7HZNrRDgmd5dBB 08w0AYOE8ww9OuBG2ArTD4lZLEoMBokyOzTmBICsmMhzyO X-Received: by 10.140.95.35 with SMTP id h32mr141851qge.3.1445400302974; Tue, 20 Oct 2015 21:05:02 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.41.100 with SMTP id y91ls830351qgy.7.gmail; Tue, 20 Oct 2015 21:05:02 -0700 (PDT) X-Received: by 10.129.116.84 with SMTP id p81mr6044468ywc.43.1445400302157; Tue, 20 Oct 2015 21:05:02 -0700 (PDT) Original-Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com. [209.85.220.54]) by gmr-mx.google.com with ESMTPS id vy6si811102pbc.1.2015.10.20.21.05.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Oct 2015 21:05:01 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 209.85.220.54 as permitted sender) client-ip=209.85.220.54; Original-Received: by mail-pa0-f54.google.com with SMTP id hk11so41665165pad.1 for ; Tue, 20 Oct 2015 21:05:01 -0700 (PDT) X-Gm-Message-State: ALoCoQk0p5d5BKiOhT76bN4QAjkrqKC6GbLQ3xJXQ7IavFubTdJpPtqNqUPzXUXiF4Oagliy1Mrz X-Received: by 10.68.65.104 with SMTP id w8mr8111216pbs.48.1445400301859; Tue, 20 Oct 2015 21:05:01 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id st5sm6445459pab.42.2015.10.20.21.04.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Oct 2015 21:04:59 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 57BB6A312; Wed, 21 Oct 2015 00:04:48 -0400 (EDT) Content-Disposition: inline In-Reply-To: <5624AEDA.9050903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.23 (2014-03-12) X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 209.85.220.54 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:13758 Archived-At: +++ 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.