From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24358 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Conversion from docx to gfm: Can I stop pandoc from inserting blank lines between bullet points? Date: Wed, 05 Feb 2020 12:59:24 -0800 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="99302"; mail-complaints-to="usenet@ciao.gmane.io" To: Clare Sudbery , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBOOZ5TYQKGQE6TLMZ6A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Feb 05 21:59:42 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pg1-f192.google.com ([209.85.215.192]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1izRlt-000PjI-Er for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 05 Feb 2020 21:59:41 +0100 Original-Received: by mail-pg1-f192.google.com with SMTP id q4sf1813756pgr.17 for ; Wed, 05 Feb 2020 12:59:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1580936380; cv=pass; d=google.com; s=arc-20160816; b=xYdWhY0hQTi8iX9ijjMtHaOZ4SyLVSWf/Q01eZKVNcU+5Mecgi6gVDnhTFYlNdqn+q /p9Zxs6xzVi5KQzCG1bBUKHx+R/4aRVAOvxHJm9JpczGxi65GHhuRo4HwGAfPoXCHG64 I75guMSyDQaOXR+OMia2m9h26nRB4d5JIpuRS1oksv9DVxpIVoxYqg4kaD8CNw9e3M17 ds6X0AddB+XeVa7hDfBf6BTk86+hCafO28V2rEXrzr2XJUKc6dEMSDIj1vAuTsF9Fcp0 +KbBWxxhfB9kwqJYnBKioWNPa0Y0bger4ljBwuDK0USfCs4x9l+wD/HrmmiXHeSaaZws qVOA== 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:content-transfer-encoding :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=tYbQi66naivJff35CNDBVMvwvHL4Xk3v+FG8LxRLSec=; b=NNUIPUU7tMyzUgXt30jXVpqyWQBhyUkTDSZVOpDO+efj2Dwb6RlKkSVFnN/Kym7iVX tDDDOv5qMdCPdeUr51rPyHxrLXX6u9UiiFC25sVYJUQulMu0XWVk14+UjL3gdditleyi NyqmTid/5Gwmw5HcH07L2BsFs8HhWwufxzSnv77b42hMm2j4BEIGrO1NMZqwS23Hwnc4 s01xRb8Odn48MSCztgcbdi0x/mxaQtNQFdK9sXlbrXnLwjHHF20QPGC0LI2Oy5bCEWjv tc3D+e/k7DigYYixjCBX+TefgxGvY2GxI6/vPskA4GSn3uFr0y8EAzmdA//ePd2OrQB0 Gpzg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=AR+4JPXL; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::533 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding: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=tYbQi66naivJff35CNDBVMvwvHL4Xk3v+FG8LxRLSec=; b=AZkRKaqHY3sQ0LdOYsB8la/9kTKHsSQy/T4mhhAaBwYN7Lj//N3GwgAfbp+q/cE37m MKuTCAcWmPksv7snp9hTIxZ3IUlekba5iXNGNdVP+zfqWwBSon3xk1rV3V01RrLeJlcp SzY6pBPv6zPIbAVt7c6lHQENzmfHRXggt6JbacKlRWrLDdhpNbDu5rfxzbZjdZegzl6D K8+Rob3g11/QTMRvAaTD9Uzquz1PnTDT4luz8UINjWiGVADuvLHyxf3XR5CoMo5eMZvD QsNuPLLfwbNEYSRCPIP3iVA8YKcyOyeENMXIT7FHuMq3gcc779RdhNMo9w486AftK5Gg ZlJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:content-transfer-encoding :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=tYbQi66naivJff35CNDBVMvwvHL4Xk3v+FG8LxRLSec=; b=nObutNKPV0Zcq8yWsLCI0FyZIEOQ3B+54qLR0leq4puFgUBb/Vf5xG3W20JrPwvNP2 aypZDHbCpvg9MVfpKt5swQ0sZEftYsrR+wrqY+dBiYBBBa81EBQgnQcNoewc+bXy3fgl ehERlXGtupuJI6xg42GlY7p4mCD/iu12hIRXa8SC9LpkjJ1G9ByRVCs7/bm2kPoGDs2j 5jsqmlqUZz2oMNUUHge0BXJ2vaDeGkvRXNoOIxJaRZAQWATLqEQiyBTcqKpGig2/sT2Q o8dNnY0wUk6p46RIRNjv4M6F7zZdUZuD8T5gJLJN3jyd8YQ9XzZNVmeQQfeyA2pLQ86c Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAVYhjRXtB2qs/txIC9HdusLfVPvrk4p3BuFKsKCFZArRHLEi4qA dPaSqI6gNlwl3qjwQgBZuz4= X-Google-Smtp-Source: APXvYqwJLs9F6aYJ2xAPRZ3w0zHGPCIb82INyKN4aTmS61ZRniTD1AZcN8+ug68Eh6gBm7OAaJhgEg== X-Received: by 2002:a17:902:8545:: with SMTP id d5mr35328327plo.116.1580936380131; Wed, 05 Feb 2020 12:59:40 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:902:9887:: with SMTP id s7ls1539105plp.9.gmail; Wed, 05 Feb 2020 12:59:37 -0800 (PST) X-Received: by 2002:a17:902:ba8a:: with SMTP id k10mr38093316pls.333.1580936377072; Wed, 05 Feb 2020 12:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580936377; cv=none; d=google.com; s=arc-20160816; b=NWZr8eCD9CUlfp6t+mpr52dsAG0i4v+YX2YKtk0RZCpMhxvSJkLcA/cNnbhulXQKkj EKEjd7WTlyyt/FMkgm712c3BF2qZblLeZjPergDeDkBOODmfjDdvIE0CmEGSL0GmUY83 2j/YZA9ROTTCLhMhmcw7e1vtEI+D81b6QT/gctwl1Gom0SmhIZ4zuhV/CYVZYkqB/xnl y1lu8TSq2t/jmwoZbIx8fDENpvoyHB/7FHJzYusLNrNwdC46jR2NGH/FdN4BfVuOfrgT PIsi75QNmx6WGrM3rqe6o9beAu4xhhV6XcoRJe49q2/igTJXTXVTBTjzNUDl1zbLkp/n ewug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=AhpBKoFs05GfDpq1sV+9bIgmyjjfNEaeVMCaV/OL2rU=; b=WzyVA7KAEuDRwi63hb7+odCp/j+c4r1YyEmUecEylVPCp6P1etzF/RQk7qN/YItsw1 /2C0Udr1CfYjVPuw70pdjr5zujHImO8kJwoXY9JruZw2qLbbaioJcFMZrIlNTd2237K/ s0cVop3Xk8vPigWY5AueijhFb/WfYLZUpvsWPXdCQXaTYTv+jjSyeyF/Uj70F5NUFs+o AL8hkex6fLVesxcaRSiFLdMj8PvMHNDj+nVr+8OBLqdl6kpWs83sez+nzhwHbbnH5l+q JpiDwgqUWhW+sNsoJDw8DcVaO5EtyvVK8mFdSIfV4KZbOfYspOs7rfPh9CbadMCGoCj3 4vSg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=AR+4JPXL; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::533 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com. [2607:f8b0:4864:20::533]) by gmr-mx.google.com with ESMTPS id j10si55225pgg.2.2020.02.05.12.59.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Feb 2020 12:59:37 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::533 as permitted sender) client-ip=2607:f8b0:4864:20::533; Original-Received: by mail-pg1-x533.google.com with SMTP id l24so1561422pgk.2 for ; Wed, 05 Feb 2020 12:59:37 -0800 (PST) X-Received: by 2002:a62:ed19:: with SMTP id u25mr39515501pfh.173.1580936376699; Wed, 05 Feb 2020 12:59:36 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id z127sm642754pgb.64.2020.02.05.12.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 12:59:35 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 83BAEA18F; Wed, 5 Feb 2020 15:59:24 -0500 (EST) In-Reply-To: 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 header.s=20150623 header.b=AR+4JPXL; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::533 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.io gmane.text.pandoc:24358 Archived-At: 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 li= ke=20 > this: > - This is a test top level bullet > =20 > - This is a test nested bullet > > - This is a test top level bullet > =20 > - This is a test nested bullet > > - This is a test top level bullet > =20 > - This is a test nested bullet > > > I have tried using the various docx extensions available but none of them= =20 > 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=20 > resulting blank lines myself? > > Cheers > Clare. > > --=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= email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/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/yh480ksgjowy1f.fsf%40johnmacfarlane.net.