From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16233 Path: news.gmane.org!.POSTED!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: How to programmatically enforcing a pandoc markdown style Date: Wed, 30 Nov 2016 12:59:16 +0100 Message-ID: <20161130115916.GE15143@Administrateurs-iMac-3.local> References: <20161022205406.GB83446@MacBook-Air-2.local> <0f0bc668-c454-4119-a62b-307e318553f8@googlegroups.com> <20161027190242.GD1044@MacBook-Air-2.local> <565f0a35-b5d3-45b3-8cde-e0c9dfe0ca3b@googlegroups.com> <20161029185445.GE5364@MacBook-Air-2.local> <20161030094223.GH6690@MacBook-Air-2.local> <1cf2f022-2a64-4a9e-94d3-f2da097709ba@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1480507207 29346 195.159.176.226 (30 Nov 2016 12:00:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2016 12:00:07 +0000 (UTC) User-Agent: Mutt/1.7.0 (2016-08-17) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBQX67LAQKGQEXQXRFLQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Nov 30 13:00:00 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yb0-f186.google.com ([209.85.213.186]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cC3YN-0006PZ-7u for gtp-pandoc-discuss@m.gmane.org; Wed, 30 Nov 2016 12:59:59 +0100 Original-Received: by mail-yb0-f186.google.com with SMTP id d128sf41734227ybh.1 for ; Wed, 30 Nov 2016 04:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:from:date:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding: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:list-subscribe:list-unsubscribe; bh=XkUPQcao5G49RPBu0wkIZCzr64aNS3Jl3adZ/clMTE4=; b=qMsPsalakiluQraDC/sCWyr6PV1ZoTfaVLJly1HWIrUkHmjSFmpzAQQduHPxjbZ8f4 dkCbEwQl9oEOfRLvyFA8l+XH0gYamj4HtoD2TBdTyc/n8DuCL+domc+6tTbY4Y9CXvSa sCQrwHu/Hd45wyKjVr4Ivi1cNO/Y5FyXpEtBNbuJ5BFguMbCCJ28yxuIgcmvOa/Te9lF yFkk2+lDIG6fVS+dwifYy08FFWGnJ78ZHpAvBBE0G+leGIxOa0yXJ/fG0dotmAIbjub9 e9HRx2LIJKuyPfBeYlKnieI9EwJihjxOITAbxPzDMwu9KVOTGO7Ddi9anTUdLT9t X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:from:date:to:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding: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 :list-subscribe:list-unsubscribe; bh=XkUPQcao5G49RPBu0wkIZCzr64aNS3Jl3adZ/clMTE4=; b=f3qKj4dI1/zHxjbDPz4xGgrVZMl4+K5M0p0J1sJCrTCfD58lLyYzxIVIAj+mRqZjPV 9onpauGGgnKDuworcjTDJP+tOH9Gjh8n7S7AOLX+1hqsv5ByGcDfdKVWRqPLJnt+YBRd Qz0SFiJsRSeFOdp3JL71sO13tvDUSKRJkwb5yB6sei8kMKlsXIpYZFav7VVUEiIzkYGI j+02sOgaGjDy0ggQ7ImwaaVMHCphdbSKlWc2ODwLVmTTdakFcQusuTUFFB8STgsCUPnk oI3rb5M8832NKk+7JCQkzGr+ybeMyBayS Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AKaTC02QwEXCr9EreqC/WFbd2qJugl+oPWXlnZHvcfqVl9dGwzvBXsoONy3wsq/eWFTUoQ== X-Received: by 10.36.26.211 with SMTP id 202mr1088688iti.6.1480507203032; Wed, 30 Nov 2016 04:00:03 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.18.143 with SMTP id 15ls4453442ios.16.gmail; Wed, 30 Nov 2016 04:00:02 -0800 (PST) X-Received: by 10.36.71.130 with SMTP id t124mr3698241itb.1.1480507202201; Wed, 30 Nov 2016 04:00:02 -0800 (PST) Original-Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com. [2607:f8b0:400e:c00::242]) by gmr-mx.google.com with ESMTPS id p14si93578pfl.0.2016.11.30.04.00.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 04:00:02 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c00::242 as permitted sender) client-ip=2607:f8b0:400e:c00::242; Original-Received: by mail-pf0-x242.google.com with SMTP id y68so10122853pfb.1 for ; Wed, 30 Nov 2016 04:00:02 -0800 (PST) X-Received: by 10.84.150.231 with SMTP id h94mr72796366plh.3.1480507201751; Wed, 30 Nov 2016 04:00:01 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id x26sm82113842pge.24.2016.11.30.04.00.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 04:00:01 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 40277A167; Wed, 30 Nov 2016 06:59:50 -0500 (EST) Content-Disposition: inline In-Reply-To: X-PGP-Key: http://johnmacfarlane.net/jgm.asc X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c00::242 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-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:16233 Archived-At: I just tried your example with the current dev version of pandoc and could not reproduce: % pandoc -f html -t markdown

a cat

~*a\ cat*~ But I could reproduce it with 1.18 release, so this bug has already been fixed. +++ Sergio Correia [Nov 29 16 20:18 ]: > TBH it kinda feels like a bug in Pandoc's markdown writer: > example.md: > > *a cat* > ~a cat~ > *~a cat~* > ~*a cat*~ > > pandoc example.md --to=3Dnative > [Para [Emph [Str "a",Space,Str "cat"]] > ,Para [Str "~a",Space,Str "cat~"] > ,Para [Emph [Str "~a",Space,Str "cat~"]] > ,Para [Subscript [Emph [Str "a",Space,Str "cat"]]]] > So if instead of writing ~a cat~ you write ~*a cat*~, pandoc recognizes > the text as subscript (same as if you just type ~cat~ ). So far so > good. > However, when writing to markdown, somehow two backslashes get added > (maybe for escape reasons?). This is the part that looks like a bug, > because two consecutive backslashes mean that a backslash will be > produced as output. > This is even easier to see in html: > example.html: > >

a cat

> > pandoc example.html --to=3Dmarkdown > ~*a\\ cat*~ > Or even worse: > pandoc example.html --to=3Dmarkdown | pandoc --to=3Dhtml >

a\ cat

> On Tuesday, November 29, 2016 at 10:05:06 PM UTC-5, Kolen Cheung wrote: > > Oops=E2=80=A6 just as I was hopeful, I just found a runaway situation w= ith this > example: >Both equations give the same result, and you may choose whichever is more = conven >ient for a given problem. *F\~ $\perp$ ~*means\\\\\\\\\\\\ the\\\\\\\\\\\\= compo >nent\\\\\\\\\\\\ of\\\\\\\\\\\\ $F$\\\\\\\\\\\\ perpendicular\\\\\\\\\\\\ = to\\\\ >\\\\\\\\ $r$,\\\\\\\\\\\\ while*r~ $\perp$ \~* means the component of $r$ = perpen >dicular to $F_.$ > > The was from an erroneous conversion from .doc to .docx to .md. But > basically if you try to apply pandoc -f markdown -t markdown to it, the > long line of escape sequence \\\\... will be getting longer. (The > =E2=80=9Csource=E2=80=9D has such long sequence of \\\... perhaps becau= se I use pandoc > as linter from time to time and didn=E2=80=99t look too carefully in th= is > file.) > =E2=80=8B > > -- > 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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to > [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > [3]https://groups.google.com/d/msgid/pandoc-discuss/a679cf14-0eea-4a14- > 85b5-2506b61975fe%40googlegroups.com. > For more options, visit [4]https://groups.google.com/d/optout. > >References > > 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > 2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > 3. https://groups.google.com/d/msgid/pandoc-discuss/a679cf14-0eea-4a14-= 85b5-2506b61975fe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=3Demail&utm_source=3Dfooter > 4. https://groups.google.com/d/optout --=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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/20161130115916.GE15143%40Administrateurs-iMac-3.local. For more options, visit https://groups.google.com/d/optout.