From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24373 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Clare Sudbery Newsgroups: gmane.text.pandoc Subject: Re: Conversion from docx to gfm: Can I stop pandoc from inserting blank lines between bullet points? Date: Thu, 6 Feb 2020 12:52:43 +0000 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006ae2b6059de7c030" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="36037"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBD72ZW4H4YPBBJ4Y6DYQKGQEZAGTO4A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Feb 06 13:52:58 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f58.google.com ([209.85.221.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1izgeP-0009Gc-R2 for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 06 Feb 2020 13:52:57 +0100 Original-Received: by mail-wr1-f58.google.com with SMTP id d8sf3311591wrq.12 for ; Thu, 06 Feb 2020 04:52:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1580993577; cv=pass; d=google.com; s=arc-20160816; b=X3dB+7d0886wI8ALXIzx53y1/fEVCSCQJq8EaSu7NjIfRGRe3Z2zykVLnwKB0hCIZN xTLjr55tPmTBkL/RKv5crPvA3+55BGb+BsVMSeien6rJ2bZgi1GNj0FNsvF7KZ2Chfsr 31v8aP7RZR8F+A9GirmWzW4Tvyyc3tIqS6TZ823Mu2FYTM5TNypGrquWIPkWC+k6g4iu V/lmd4cFS3r/kkmLGd9Azs/14/0w/OdAumC/zH7uCEw/nW1WimDdPteg3+/2Kmq4i+U7 2y+9Hf91yYdDhkWIB5qyZINImcCfknRp3JC+hnC3ACAJKOiNpweBeVAuaM//i3sTzwNg eblQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=V3MQM7bIN0mPb3Z7vexjN0kXpOR48gYrsdlRqM43LRs=; b=am/kTFuWSeN0LVH3zOEKSNNaHLxs1iRVI29teFIJabupGVnRbGvoN5oZfTEZzVWWGy YhkJBlzAK3u+Z956WFYB3jTAg6salYHXs+UB5J3Eopg9zUmddL/kP6SX6YwfJyccuz2T iJaFfj5vs82u7nMFPfUaixN3g1OZFTCDWDqqD6zKzUTWWWh0qF3ZOF8/GtuHKHTEcpFT /IHnj0MXAOCHHzmNAFP74dyl08ujD+QHsxFdSoHj58Oo30zW8Daju33uteaabEf7culd RfahrUdcKDRV6TkjjiJ71P2+Hfo0iqiCF+yaxmVbg6+KWB335iXD/1pR3V2I/O15yFWb Y6ag== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ea7QjAgy; spf=pass (google.com: domain of claresudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::52b as permitted sender) smtp.mailfrom=claresudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=V3MQM7bIN0mPb3Z7vexjN0kXpOR48gYrsdlRqM43LRs=; b=cDHePg2xwz8baV/qzcmYSPE+AZlADB6hulWckKAgSwFPyAyhTHP1G8MMJEKVs+Q2Mu 17dlKvVjR/NnHRYPKKq87b12AU+ViLKeQsgiRhshfN1YxYDNxnoQmx5WbNn7nVkK/mzQ 8tnE7OW7jIt0JbQkh/FKZLnHz7LU707lap6Z0XWl4eGWWwdn3htWFv5Dlgd9n1UuMtHM +JjU20bEpdrGG+XNrFfOG4wQe7n6VtJ7PwLSSto+3haexCUm1yh9hUyYVJwcGNnvGTvg GQ1IscrglMekHirA2cYREbvEoieTtBrLQDkUd+7dacFjWYS8PIsUNzIYce5bxQC1d6Vn 7gmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=V3MQM7bIN0mPb3Z7vexjN0kXpOR48gYrsdlRqM43LRs=; b=KVFepEbajHV5+Xhc2+d6vwic7YzSKYv1c8ltT98wlRhys8oDsVfxmHbxSgg17t2c30 KMeDMwOuQ1CaDHgWu4AuewBcD5ozRzAm9J6Q5wLLlVz9Y+pxAOTptAqSa14xbbsKWfvF OKUBQcxEBtcuiezg3U5g9+/H5N5ghL4FH9dOwDwgVS632UPyfxI+Ui0V1/8hzXGn/lmX /kD6WL/acUgN3rKcQYTK1dnXYx1fJxELD1g4AqKUfOX5Fx1t9oGp1sphm6vI/jIa3KHt sTjQkb/+JYhLuCm6B4aUdnyLRPDp0YrGd3LiDTN+vqqd2sNTRkK7u9Q/5eNQVCXcUJfS 3WRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to: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=V3MQM7bIN0mPb3Z7vexjN0kXpOR48gYrsdlRqM43LRs=; b=Z8EyxBiqJJtnIrP/3NJbL+JgN6H0SrdbzBkYVvMzs/R3klHgDOKXmnjTSLxPA1/dDi uPXPiykBduqm84MiOwwYWcJXxxOezw6l0PkeR2/SiYCkbllCFCVFk68R0cptAvMnvucq 32MuFjNEOcGWTJPEXQOe2qW+tPMEXtBu48K5WdrYJHPaVpsFT2sK8QB+nLEDZq2zUQlv X4h0oy6bZmg8uiKWwknWiBqJ/HDvDpi7kM5KTt81Mdqj2A80nB0tGFLQqCq+64EAqT8f b6erDWGtVTpjkggHE0U74PX8zsmNnmVGPwgmZwq6wero8ZcNQ3Xksay124FZQI1nRF6m zT6w== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAUBi4iOKHSt1J2u1QNFB1p/bOqJ1yKVOoaP4dAF4ke5tSn/MHxd WjZPFUSE4N2OXXNc8/EbJa0= X-Google-Smtp-Source: APXvYqxZMZGjYOJX3N//OTQeSvQN+08TTssNRVI/T3tdqP6qmIvpTScfr8DNz6ZFN4jDZfKprDZLFA== X-Received: by 2002:a05:600c:22d3:: with SMTP id 19mr4587809wmg.92.1580993577530; Thu, 06 Feb 2020 04:52:57 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a5d:65d0:: with SMTP id e16ls3696472wrw.1.gmail; Thu, 06 Feb 2020 04:52:55 -0800 (PST) X-Received: by 2002:a5d:538e:: with SMTP id d14mr3867143wrv.358.1580993575445; Thu, 06 Feb 2020 04:52:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580993575; cv=none; d=google.com; s=arc-20160816; b=NYPRgA8LvnEwmgXXI6KhKmLZJToUi6gaRVMgTwVlHQfkaUhO25MWByAimLRrD2MBfO 6Rsl0FdORDB+kiy9cwgT4CTePpbplfd5kq0B4yyTS2g+jExaruE6moWMbSyjIl1JTJyb ruoQx8mNaUMbN9GIdovBMzA3VNmFvfKRUtUfxeVsI5Zkap5HbkqgLYCf9HJcXnjNJIbr V711H7ysScUapZXT7BtZeD8y4Gc3FiZW6wSxQqr7QtB1wrbWXHDpblKLUzEqszCezLXc 3Kq9weD1gDCYTjbIeh0EaQ9EIRgvnpSHuWYee3BVCSR+N1CP1KjiAWM+BIv8YMxNaOHe f+YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5kiI1O2LazOlPrtGML8BOE1wVReLNG1Ix1tYZzAkssQ=; b=dxaKsWQTIjt0eP3PP7J1wVpLST47MzBynTHSzCFrib/39aF7RoJigGWycrKb61R/Bb MeHmE97pOwCKlgniG1CtmZF28OzbYPfT4/Gle8qRALAGxJB5XBuDt+Ydppj6FBAt/6iK 3HNKFKap4Vri/2dLaus7Jo8/9HtOkSnXclGWkDgfPQPfx2NuK2OrZ2vWfAfIX9TmVrGo o3NHwS32jrwuRKy5IzQjw0rUIcRE9VknOHAav0IH2JZ80QpXG3isPj1XnjSEvvq/LNoA btwODEuztvXWZWXpNVGPJSny7Ja+Z9qqUeT6r2+KRy08tJe9c0a7bGtiqh6oG+WLJFjW Ivfw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ea7QjAgy; spf=pass (google.com: domain of claresudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::52b as permitted sender) smtp.mailfrom=claresudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com. [2a00:1450:4864:20::52b]) by gmr-mx.google.com with ESMTPS id m2si494060wmi.3.2020.02.06.04.52.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Feb 2020 04:52:55 -0800 (PST) Received-SPF: pass (google.com: domain of claresudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::52b as permitted sender) client-ip=2a00:1450:4864:20::52b; Original-Received: by mail-ed1-x52b.google.com with SMTP id r18so5834024edl.1 for ; Thu, 06 Feb 2020 04:52:55 -0800 (PST) X-Received: by 2002:a05:6402:61a:: with SMTP id n26mr2729534edv.135.1580993574788; Thu, 06 Feb 2020 04:52:54 -0800 (PST) In-Reply-To: X-Original-Sender: ClareSudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ea7QjAgy; spf=pass (google.com: domain of claresudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::52b as permitted sender) smtp.mailfrom=claresudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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.io gmane.text.pandoc:24373 Archived-At: --0000000000006ae2b6059de7c030 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Fantastic, thank you! On Wed, 5 Feb 2020 at 20:59, John MacFarlane wrote: > > You could use a lua filter; it would have to replace > list items that consist of a single Para element with > list items that consist of a single Plain element. > > This filter will do it: > > ``` > > paraToPlain =3D { > Para =3D function(el) > return pandoc.Plain(el.content) > end > } > > function BulletList(el) > return pandoc.walk_block(el, paraToPlain) > end > > ``` > > Save that as tightenLists.lua and use > > --lua-filter tightenLists.lua on your command line. > > Clare Sudbery writes: > > > Hi > > > > I am converting from docx to gfm. > > > > My input Word docs contain simple bulleted lists like this: > > > > =C2=B7 This is a test top level bullet > > > > o This is a test nested bullet > > > > =C2=B7 This is a test top level bullet > > > > o This is a test nested bullet > > > > =C2=B7 This is a test top level bullet > > > > o This is a test nested bullet > > > > My output markdown docs contain blank lines between every bullet point > like > > this: > > - This is a test top level bullet > > > > - This is a test nested bullet > > > > - This is a test top level bullet > > > > - This is a test nested bullet > > > > - This is a test top level bullet > > > > - This is a test nested bullet > > > > > > I have tried using the various docx extensions available but none of > them > > seem relevant to this issue. > > > > Here is a sample pandoc command: > > pandoc -t gfm -o "/path/file.md" "/path/file.docx" > > > > Is there any way I can avoid this effect, or do I have to remove the > > resulting blank lines myself? > > > > Cheers > > Clare. > > > > -- > > 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/b8f1db8f-2905-45ea-bea6-= 7cced40456f7%40googlegroups.com > . > --=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 view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAJePrFq_%3DWS1d%2BmbdVLGLFMsTq%2BVoxOFTCoqgPsCA0pL3oaLHQ%40= mail.gmail.com. --0000000000006ae2b6059de7c030 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Fantastic, thank you!
On Wed, 5 Feb 2020 at 20:59, John MacFarlan= e <jgm-TVLZxgkOlNWn+EJxYGL2xA@public.gmane.org= u> wrote:

You could use a lua filter; it would have to replace
list items that consist of a single Para element with
list items that consist of a single Plain element.

This filter will do it:

```

paraToPlain =3D {
=C2=A0 =C2=A0 Para =3D function(el)
=C2=A0 =C2=A0 =C2=A0 return pandoc.Plain(el.content)
=C2=A0 =C2=A0 end
}

function BulletList(el)
=C2=A0 return pandoc.walk_block(el, paraToPlain)
end

```

Save that as tightenLists.lua and use

--lua-filter tightenLists.lua on your command line.

Clare Sudbery <claresudbery-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hi
>
> I am converting from docx to gfm.
>
> My input Word docs contain simple bulleted lists like this:
>
> =C2=B7=C2=A0 =C2=A0 =C2=A0 This is a test top level bullet
>
> o=C2=A0 =C2=A0This is a test nested bullet
>
> =C2=B7=C2=A0 =C2=A0 =C2=A0 This is a test top level bullet
>
> o=C2=A0 =C2=A0This is a test nested bullet
>
> =C2=B7=C2=A0 =C2=A0 =C2=A0 This is a test top level bullet
>
> o=C2=A0 =C2=A0This is a test nested bullet
>
> My output markdown docs contain blank lines between every bullet point= like
> this:
>=C2=A0 =C2=A0- This is a test top level bullet
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0- This is a test nested bullet
>
>=C2=A0 =C2=A0- This is a test top level bullet
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0- This is a test nested bullet
>
>=C2=A0 =C2=A0- This is a test top level bullet
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0- This is a test nested bullet
>
>
> I have tried using the various docx extensions available but none of t= hem
> seem relevant to this issue.
>
> Here is a sample pandoc command:
> pandoc -t gfm -o "/path/file.md" "/path/file.docx"=
>
> Is there any way I can avoid this effect, or do I have to remove the <= br> > resulting blank lines myself?
>
> Cheers
> Clare.
>
> --
> You received this message because you are subscribed to the Google Gro= ups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com= /d/msgid/pandoc-discuss/b8f1db8f-2905-45ea-bea6-7cced40456f7%40googlegroups= .com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://g= roups.google.com/d/msgid/pandoc-discuss/CAJePrFq_%3DWS1d%2BmbdVLGLFMsTq%2BV= oxOFTCoqgPsCA0pL3oaLHQ%40mail.gmail.com.
--0000000000006ae2b6059de7c030--