From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29808 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Normalize adjacent Emph separated by Space? Date: Thu, 16 Dec 2021 18:49:37 -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="blaine.gmane.org:116.202.254.214"; logging-data="23116"; mail-complaints-to="usenet@ciao.gmane.io" To: "christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBTXV56GQMGQEBXXG2SQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Dec 17 03:49:53 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ua1-f60.google.com ([209.85.222.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1my3Jg-0005op-Co for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 17 Dec 2021 03:49:52 +0100 Original-Received: by mail-ua1-f60.google.com with SMTP id e19-20020ab07e53000000b002f9b403017asf587011uax.16 for ; Thu, 16 Dec 2021 18:49:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639709391; cv=pass; d=google.com; s=arc-20160816; b=D+2ihiFQQvDy3qQ94l0cYZUxG5gHvRuD2+ooi4cDoyOwqSPLd9dkV/zHHfUhvUKJ3i HdHYH3ttRFGErBcoeBEJKPjQphN49JXua1Bou73d/D5nCSYZIGxJRwdrSUF6SziSYtnh DqqaiDd4i7uJDePGmsrQgn9R8KtJbhqmwxCzzNAcIQ9oTmiFw04py1hdlvh0j0Q9yoKD k1WYxHgnDMiM/m5GNqaHWQn2VNHRlh5y1bjQ+5s7LF3tId4LeyP8JSrWzIoWm0b8yAi1 hqr9/cCQBFdOImXHnLqQzUFWEz0/PHNoEIj4Gc2C0XIhyvmzDAfHwJNxosrnpEN6tCa9 QkwA== 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=fBTbs86gtwwiQNaX4/DJv22KetCHnp8013lrwyG9vi4=; b=irZTx/u84arW+E3l1ElqSfS02M+NqRUk5LfYbI3u1WNr7UT49B6ItIMLQsg/2933Zz N270t9oygoij4scHnNmV1T2WRinhPh+2dVrksxMUJOt6TCOt3DEXMvj30JsfVDskFfUc lAK4nLgsAPh3HITtIk+ngZmH0yaz9/4G+JaV68mWBE7EO4CCn0Zadf+DLruv6foh1Vw3 xsRlwnILdjyKtgsmK08yexYzdY6yOy1CkMXvG/E8hGBYBCkAyouQRa3Vs6t07EFr9urf ZPtNv/O1lK2+8RWShGOY8MHOppbmti3E7iG877XLgSZRlP8BmtbkdVvVpCg4DrZL8vLn Udag== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=JT0cwuS1; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::432 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=20210112; 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=fBTbs86gtwwiQNaX4/DJv22KetCHnp8013lrwyG9vi4=; b=C+M7CEWRs0oyeW851tp5iqOlYFkDepJq5n4MD572zI3uGNB+8JqNSCMlgIrsLrLIoJ top0k9MUafHzObArdC8tFXp4MpXGc5BtMMSODVGWarIKnDkz1G33v4NRYGuzq3RSna0S DF+MMnWxmf3MMqMb+XJOyPZ9fsV/Az2dh1d0HsFI2DqM9+pelbQjGKOc9XOa3sfkblZf DBflOUPIG9rhJEYWPxqCcG3mdc8R9cxXuM3zDSwOwqIPeR3Av2TUmkrsDDL2ilMDkff9 D5PkuoMEg9v0VD1z/j9uyvXKgC5D15ADOtJXLnlF45X6soBIY5tKiclnLRLb2vw2r9Hm H0Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=fBTbs86gtwwiQNaX4/DJv22KetCHnp8013lrwyG9vi4=; b=iysKVtDhcTDfFVgMm3MhgJwzb2C+GnMBJfW6h8g9F+B9MPXSuJn9nxSB7jKZ2yi2oB fB/tiTuTX/6PvchAfq2C8zbGmumT84gZJUsNqbX4e3BgqZWaOCZg7aWuZ8RuVawrEqYv XDcLDyJF9D+hBfjsQU4vGZlRZfpcr9KtE4CdyQaTzmrm9A8PyT9762Fuoczh1mccdKG9 RCmOveMPuTGfHOrPHwlTHaCq/xnrA9FTQNTh2CyF1KqiUdbrzeuCMdunwLCjPMNLUPYW 0aOaZUUhZscZ0a1odF8uDCw1UBg4oHP//ZP/bGfgbkpLAhqnFZOKmXABTmAbP2rEpxyc Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530DoIgVoz9BitfhotPmWrfo6w6A/qQd12vKjpPsDp/hlPQ4tJ8K zCgkwMqqiD+gVjiJ2WJcyBY= X-Google-Smtp-Source: ABdhPJyxfIBl1GzL5KhPCtVGaMLSIgRFTQADiuL+m9veoC8U1bnApH8dMR0XQzoxUojLNWZWU8qqrQ== X-Received: by 2002:a05:6102:38b:: with SMTP id m11mr345257vsq.36.1639709391434; Thu, 16 Dec 2021 18:49:51 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ab0:6ed2:: with SMTP id c18ls651851uav.5.gmail; Thu, 16 Dec 2021 18:49:49 -0800 (PST) X-Received: by 2002:ab0:6414:: with SMTP id x20mr255639uao.81.1639709389794; Thu, 16 Dec 2021 18:49:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639709389; cv=none; d=google.com; s=arc-20160816; b=l02c4nvEOkEPVYBVV0CHJVmaYFS/ttQJAUwlE/2jcV+cu/V2UnWGgdUIudjXASFoL5 e0LHBFaU/ub/47k1No8tShnAy4zvQ+zZaOpdcULQguQ1X0panfNfQQNG3DucBQT3Rzhh TwOfADyEvEEi5HXeCbKbjGXsimFEGEsyCa+OiAKqAQVUAsbMIFOKTK96dQIKv6qcmDEX Ikgbj56NJNMyb+QnNHflrUMtvrjuhETrv7qPSoR2mTtbsg8Cyse0KHSl2CcjEXOriNA6 0KvvaXNXzaOGcmtq5F8q+f34M043morGlvIdVxT4b5jvhd2aEsrAvz7seF4iVq28hWgL jGwQ== 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=Wtz7z9vVpmiybiZuRhGp2R5S78XshZE5TzHjW3J+bbQ=; b=jvP0Ra6RNBX+3tduQZxlPvwxIXWzBItEhm0vy6ej1FXun11JjrP8CKFJZqMFXWAteB lyEi+QhyTPbPp+ElUz+z/+mAFb8BYpPgLHQssdwO5jWupWj7vhgOQV9qjtWigHAHeaak pdM9XuWjlR0wz0bgo441t8XqoRsshY/F0gS3SA9XJdBkd6FB6p2EGrMPEuyZhkc3WxXP V8JwTMMXoyNDTqxyoZn+p009HckYWlHibYqGrW19rCc+/s6KuXQUov2l2M6Um2smmNMh CoGsWz/QxT53h6/hPAFca1DN0NljjNaR+3AubsgzTiDAO+THMZQqJVIX7CDTXEmYbJ1H iYZg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=JT0cwuS1; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::432 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com. [2607:f8b0:4864:20::432]) by gmr-mx.google.com with ESMTPS id g8si602997vsk.0.2021.12.16.18.49.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Dec 2021 18:49:49 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::432 as permitted sender) client-ip=2607:f8b0:4864:20::432; Original-Received: by mail-pf1-x432.google.com with SMTP id k64so977537pfd.11 for ; Thu, 16 Dec 2021 18:49:49 -0800 (PST) X-Received: by 2002:aa7:8b07:0:b0:4a4:d003:92a9 with SMTP id f7-20020aa78b07000000b004a4d00392a9mr923186pfd.61.1639709388635; Thu, 16 Dec 2021 18:49:48 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id w16sm6761298pgh.81.2021.12.16.18.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Dec 2021 18:49:48 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 35298A1D6; Thu, 16 Dec 2021 21:49:37 -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.20210112.gappssmtp.com header.s=20210112 header.b=JT0cwuS1; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::432 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:29808 Archived-At: Yes, normalization is handled automatically -- but what we mean by normalization doesn't include your case, where the Space is *outside* the Emph and would be brought inside it. You could write a filter that does this sort of normalization. It would look in [Inline] lists for the pattern Emph xs , Space , Emph ys and convert this to Emph (xs ++ Space:ys) "christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" writes: > Hi, > > I recently have a situation that I want to have adjacent Emph separated b= y=20 > Space to be =E2=80=9Cnormalized=E2=80=9D, combined to a single Emph. (And= variants like=20 > this.) > > --normalize is removed in=20 > https://github.com/jgm/pandoc/commit/8165014df679338d5bf228d84efc742c5ac3= 9d2=20 > and I=E2=80=99m not sure if it is related. > > Example: > > $ echo "*text* *abc*" | pandoc -f markdown -t native > [ Para [ Emph [ Str "text" ] , Space , Emph [ Str "abc" ] ] > ] > > Is there someway to make it > > [ Para [ Emph [ Str "text" , Space , Str "abc" ] ] ] > ] > > Instead? > > Another example is (perhaps generated in a filter) > > [ Para [ Emph [ Str "text " ] , Emph [ Str "abc" ] ]] > > Is there some way to normalize it to > > [ Para [ Emph [ Str "text" ] , Space, Emph [ Str "abc" ] ]] > > When I say =E2=80=9Csome way=E2=80=9D, preferably it is some pandoc flags= (for example=20 > native to markdown then markdown to native is not reliable for the space= =20 > problem above and won=E2=80=99t work to merge adjacent Emph), but even if= we=E2=80=99re=20 > talking about doing it in filter, how to do things like this reliably? > > Thanks. > > P.S. > > Even for > > [ Para [ Emph [ Str "text" ] , Emph [ Str "abc" ] ]] > > won=E2=80=99t be normalized: > > $ echo '[ Para [ Emph [ Str "text" ] , Emph [ Str "abc" ] ]]' | pandoc -f= native -t native > [ Para [ Emph [ Str "text" ] , Emph [ Str "abc" ] ] ] > > But the text in the commit message seems to suggest it should: > > normalization is handled automatically by the Builder monoid instance. > > (But the commit is old so may be there=E2=80=99s more to it in the later = commits.) > =E2=80=8B > > --=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/c887615c-9a1e-40a5-b6b0-a7bf22c87350n%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/m2o85g6j3y.fsf%40Johns-Air.hsd1.ca.comcast.net.