From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30429 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: spacing between items in plain text Date: Sun, 10 Apr 2022 11:59:13 +0000 Message-ID: References: <25169.62483.641766.380124@high.jcbradfield.org> <25170.47468.723172.999462@high.jcbradfield.org> 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="blaine.gmane.org:116.202.254.214"; logging-data="16068"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBFENZOJAMGQE3YINFXQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Apr 10 13:59:21 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f61.google.com ([209.85.128.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ndWDv-00041W-5s for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 10 Apr 2022 13:59:19 +0200 Original-Received: by mail-wm1-f61.google.com with SMTP id m35-20020a05600c3b2300b0038c90ef2dcesf8652718wms.4 for ; Sun, 10 Apr 2022 04:59:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649591958; cv=pass; d=google.com; s=arc-20160816; b=FbTe170nFbrakapT4RVryH6B4LHLo2xpuVCIWLElMMtZN0MGtmwqj1Wx7Ej5wvUnBw NRlMGhh0+ith4kzgE3L1gefBGTFLO0hQKqxWvyVKNfciwqPblcntV/BcluVZOFy0oJQ7 Nc5p56rhOOdenQ2Nidw5zF4X6XArLzLcpUPGR3RyL+ZL+ksKVVI5ZH2JMqS/04hmY9Y0 U8mXTEe0S9yN9Njxzg8oarytjpKJi87WqUmSCaIXYQ1IajNjE0+fikaDJnckV7nezHVi EBxkjvukc9S/ZwVDfQgCyGof2QOXSns4A78ET/LRvuNkdiwKFjMzU2/dqSYAv0AfDGPE I3LA== 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:content-transfer-encoding:reply-to :in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:sender:dkim-signature; bh=Q9rDsMRT7g/NwujbTDqrC9nGSVroRFs44AEJ2YfxLPY=; b=wI2vlJZ5sS0mlR6RNEATngpXHZ0Cfh/WkgvwHN8Dn0wpRAs6pVleQIjFwfMJ4dG6zK GmJj3VpwxNk6anfuXjhSMm1WiA13iEZgaCuCW7Nd9TajpEO8srfiRUdpbtbvxIPW2NpP bxRquaxaBWOOpNqp/36mymrInX/bpyeNPCKTikJKSEkoX9upHiC/yrI0hSX3UC1CXN0U ELoLXBkdWQSDskZS0Eojvp0yWQdznAfVNR1KnPS9V1miugeC8SRqQcccAZARpTZzmxk4 VJwXPBhIELIkiMbY/z83jgAYDTKc4rpAUmfiZaoormPdvWNu7/DMQpdcP9U8KcWpmuGZ UP3Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=qzRvuj89; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:x-original-sender :x-original-authentication-results:reply-to :content-transfer-encoding:precedence:mailing-list:list-id:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=Q9rDsMRT7g/NwujbTDqrC9nGSVroRFs44AEJ2YfxLPY=; b=jEXlosaHg9RhhqI/e1sKbiuicWMvWTc/ZQ5C8AWJz/q5ApiafTXABd+jWr4YGM+XsP EWd9zaAGUX8Q2+c8OoPjPoaIzhVXo7sO8CfrdfZJFjHz+QasYGabQbq3MjKYL6onZ39t I98xP74icBLB6PvfihTvZD6UE4kNSpNmxHU8DnQDrrK+6ubGJi6Qxze1p5ugEXNQ8OXj flO7oX/dWU/1Peu79so2g19nRRJAktqQY6Pm+pYyE6bR9tDSYVroMNALMxK9tNFJjdka o+VWe5agfWQIVCf6P8qCysW2ZWGHxLToD+J4C6BJq8KYXq6P8/q2tWS4BhDk5d1sbdMB tPbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to :x-original-sender:x-original-authentication-results:reply-to :content-transfer-encoding:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Q9rDsMRT7g/NwujbTDqrC9nGSVroRFs44AEJ2YfxLPY=; b=eUw5r9Lq/yCSFtUBVSoFo3sx+WhEusDPRyt1u571tL15Le2WvCHf00Mz0xa2hSfQjc ym4rXcCYTmo3Uu3yU2eL/xv2NLx3By0nWo6qlyXAbTS6JTaBUHnhPG689/+sLKCu3M/e DJYKHsf7VFGIlTSC989tYfPDmdj9UiZC9XEk/CCFTMd+YPGlqjThU2quCpTtuiI5tujz 6gPxK5/e7MlGsVoM5ErgOceiDeAJPBSwtHa6bvSzU3NmvYnYzTnxKSJKIDh6CDfljURg 0/nvtLq2ilQ84rdGNcQm1YFwju815UojoBurAA4T7Zrn Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530HZRwI6prVL1sG7hUDyDu38gfEJFxabPnssgTj34axPEcRTl1V 14ti06L7a09D06rWsLnzRSA= X-Google-Smtp-Source: ABdhPJyFk/pXb0HieCLEy6mrdUM1i0v/lZ3U+BqWWtF0ueNf1mLMj29/FMGWYzuQUWGjyUJY1YbKXQ== X-Received: by 2002:a05:6000:1848:b0:204:e90:cb55 with SMTP id c8-20020a056000184800b002040e90cb55mr21278416wri.58.1649591958817; Sun, 10 Apr 2022 04:59:18 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:3c99:b0:38c:ba37:2f74 with SMTP id bg25-20020a05600c3c9900b0038cba372f74ls3150150wmb.0.canary-gmail; Sun, 10 Apr 2022 04:59:15 -0700 (PDT) X-Received: by 2002:a7b:ce99:0:b0:38e:b72a:382c with SMTP id q25-20020a7bce99000000b0038eb72a382cmr3304529wmj.128.1649591955471; Sun, 10 Apr 2022 04:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649591955; cv=none; d=google.com; s=arc-20160816; b=zvZ2M6vSnEBsqq4n8NOikgo7qgpoUf2n1IkmjqMT/L1FFmk3NCxXrnT1Co/xd1LfEZ /1dR7eTNOwbEfloZ7GNTguJI31i/P4cBwuNG8C0zxYf5HeCgPETQcEhHijRFZvyf112P lpo74iHQ1KEuGlY6KYuE/ZwVqvzSCoqVbdFGE6NpuZceHHcKr1FO3Htj2gAjQN7pa8pb tvVES5GA3Ddz6/f6zwiIMDZjS0gtTRilP6vL49FknD5/h7FH7MlP1mpK/8IrfyXb2V84 7QF/EFYPqcTvbZ/xH7KCRX9rnFpxUIrdgYvu/fIE7NMFzCqgL+Nf36yftTqTX7WGdCb6 nFZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:dkim-signature; bh=troiZkw+rhg0ViqBFV9Tze42r+PA5i9BSP47e7EQHgg=; b=MNaXg8P/ETpslUhlQvMuFA166fREiCGpHF3lv75rjAgXAWTFsKMdlM+ZwKKPHdjgfP uAj8RJyFAOFzS7xmZUj6Rd4PuEm+MnXeQlMYMt7Gh0rae+nmMjpH04DpLe1yHmHXiGDp xUxYYE8CYMitXgSq8oD9rhEVCwbTRtuh7AyQ+okGN0RhSRu9Hi4RqVeWLGLQ2Jhy8ame vIfl4UArB7jFBVZSIS/1haqTqM1SGI/YKi3gxpr/rfnLw0Ko868wHLy/DP8zosT9Hk+n Lw0Ka3viKDCKBH0dUZ2I5BeuRmJQ+3CvaFBgT0J7xSEoczh/CMFjERNlp65EFKuhPHLY IuXw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=qzRvuj89; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id bh13-20020a05600c3d0d00b0038e564ac2cbsi892180wmb.4.2022.04.10.04.59.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Apr 2022 04:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1A1AD240026 for ; Sun, 10 Apr 2022 13:59:15 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KbrBB3P8wz6tpD for ; Sun, 10 Apr 2022 13:59:14 +0200 (CEST) Content-Disposition: inline In-Reply-To: <25170.47468.723172.999462-2Bkq8O7kH1dDWdl4zjylUmD2FQJk+8+b@public.gmane.org> X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=qzRvuj89; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:30429 Archived-At: > As far as I understand the Markdown spec, the level 1 list is loose > and the sublists are tight For the same reason, it seems to me that the current output is right. But y= ou can achieve your intent with a filter. As `pandoc -t native` shows, loos= e items are internally represented as Para elements and compact items as Pl= ain. What you wish is to replace Para elements followed by a BulletList in = an OrderedList or a BulletList with Plain elements with the same content. The following lua filter works with your sample file: ``` local function isCompactList(elem) return (elem.t =3D=3D 'OrderedList' or elem.t =3D=3D 'BulletList') and elem.content[1][1].t =3D=3D 'Plain' end local function process_list(list) for _, item in pairs(list.content) do if #item > 1 and item[1].t =3D=3D 'Para' and isCompactList(item[2]) the= n item[1] =3D pandoc.Plain(item[1].content) end end return list end return { { OrderedList =3D process_list }, { BulletList =3D process_list } } ``` However, if you have more than two levels of lists, you may have to run it = twice. I wrote it as a proof of concept, so it may have shortcomings with m= ore complex lists or corner cases. --=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/YlLGkRv0l4t9WE2t%40localhost.