From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30905 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Normalizing spaces in italics Date: Sat, 2 Jul 2022 10:49:48 +0200 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007c227705e2ce96bf" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14286"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBOMNQCLAMGQE2TC6C7Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jul 02 10:50:05 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f56.google.com ([209.85.167.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7YpJ-0003YF-OT for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 02 Jul 2022 10:50:05 +0200 Original-Received: by mail-lf1-f56.google.com with SMTP id f29-20020a19dc5d000000b004811c8d1918sf2064487lfj.2 for ; Sat, 02 Jul 2022 01:50:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656751805; cv=pass; d=google.com; s=arc-20160816; b=0m4s9WEn39kmjC7cgMbWJAigKEb2DgMkB5gAQO9ynnZyG4QM6kzlq0ULvgfa3c6sSA dR4TBfS/JnzpZkigh0g8XF3Kuv9ufEU+nEwHtW7+Awu7FOato0IMqgiDlvFp6IxR408X bSCnGedP8WWVjMoMXNLahyzGVc8BzJU+E1zpeYXN6thgSIvoSFEmvevCxAw7/WRhgLl+ RP2YP/JNikptdvgP/2/9NIzP6OuBEbDGJgXOoaBIviam858GTHaHuJGkbW8mifRHnht5 tVgNtcDz6R5ML3uA7z9xyUogXUTBX0kGiSsDQYzgxhBTo++HjO3mhhQTJht0TvkykFnp QL+w== 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=hMQRAz2tfTyN/eaMqN31xqA9zPOyXYxfPSfEjQMVqqU=; b=NYRO+ryjh3hHzDARCZg47tOydJaP1DazBYHf9Ojn31/93D1r8YemUF0Fqw3qeGUIc2 cvztjFHWC+EZwLFvywZsswIsM1xrp90G7WI2Ch9kGSVLJ9slqiN3v5XH+hp8Mxj3gous KhdTAbJKyWUDO6KQYwOA/GYEs8BSXINyhu1JJcfLUo1MIQWI5raJbkIng/k0lqTS8luA D2coD0uPK3+UsW68yYg1Xp2hwHZ8mO+zKRk+pt37Qpm++XS5dfKqtdV7my61FgqFtxeL wMQ7bot4qgAs+LeSY5d7SftWt4tmxFuUfMFMsZGb75pWTx543E8hI1LbdQgqw5VtkoZQ aY7w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="pe7ES9t/"; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=melroch-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=20210112; 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=hMQRAz2tfTyN/eaMqN31xqA9zPOyXYxfPSfEjQMVqqU=; b=dvuwZKtLsLtT/vfXmpmxO7yM4XbyOJdWX8xrcabT0pfZ3pBpjMhJY7SjevI48HCl2z iZAfLzTtuR3y1evbhiKwM4kAqE74yZ76y3NvkfaTd3ozRiXOlFj65QkiyUEp3nklw02W 91lkA9IhZjuqoS815/ei7xhPmtVIfJceDPNzyf2TFBGm4QbsxqmtYaMdFi8f5LZKvF+r /6m3fBBGw9s35U3d5WjOyk1fOuRL+tyam2/cWI5DkdQltcgWFJ1XcsZo5ifu4Dd2bapY 5pENKpXSsEYHfdlvAb8JR+kspSIlMsmjnjw/5w3V5cY41y6KyDz4nBPasFJOVOZCLDbh MQ3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=hMQRAz2tfTyN/eaMqN31xqA9zPOyXYxfPSfEjQMVqqU=; b=fFBiFUpUKoZwyse5FAJslk5R0ER0+YAiOR9344RMNiXpQFS1N1wIj6segTbK4Ib4Af VQovkPuA735b1JlEYLA1+++CwlQhcbfauKsvabG8voHZydC8gzWDxbleUVOWPwBExTtG DjQ1wqG8AJNTNYU6wLOnEbxGITnENCSdCW9G9dUSHqmaaNgSWINNNbMZLOrMYg4Q0e/g YmJLP/3TQGmYhEQMaSiuKGNaDawVnXgD/wvlFdNPoqQ320Gmv6JB/ztSVAKHAuHAiozJ isf9PGS/PjmbuJAzzLmD7LDflGXpj/NW/wG+324hJ2175XT12n3tEoUOETh7hAHEF2h0 KroA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=hMQRAz2tfTyN/eaMqN31xqA9zPOyXYxfPSfEjQMVqqU=; b=2OKvNzMgO3gCSNPU0HITavClOakssphvKFuqvLmiXJ3Mv78HW9yIEsO28C2KmTzAKi 8JfBoZ5CyeL6ma1i4gYHP7DqdkdEgXqTNYu92m6ozLyBS5cTlheUN2OHA3cPQq1uk38v oXmmPLefDcIQXwsi58tnrtoEtSY9p7gTcAPcpoqWTP2Jrac3nIRema+PognfRTBNZKRO 7jciPT/8aElPKbRveWQQZ8eTXAiklBxJvyRhGVmeTPleSzrL7GTpxVAVbAnjVtBfsKUq MOqq3S3sTmRGeUszP11393FNbBbzVq1eeT8tWA4gT5Iz+E9D272xNHv5N4xorUDmy42I /msQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora8Zwa0akBQa6Q72heB/tVle/6HRzrx+oXS61Y8p3fBcKMdFi9l1 GworGMy4Jiq5SkyYgwA6nU8= X-Google-Smtp-Source: AGRyM1vY2CtW46G2HrsrTx8+z5f4M1hT5n2wS4/mSBmIFub2PJM/PpIHcCYN00HjGDmUtDEIQUrxGg== X-Received: by 2002:a05:6512:b96:b0:481:95c:e36a with SMTP id b22-20020a0565120b9600b00481095ce36amr12392336lfv.33.1656751805257; Sat, 02 Jul 2022 01:50:05 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6512:238e:b0:481:2fa:2826 with SMTP id c14-20020a056512238e00b0048102fa2826ls1247812lfv.0.gmail; Sat, 02 Jul 2022 01:50:00 -0700 (PDT) X-Received: by 2002:a05:6512:31d1:b0:47f:5d39:1d9d with SMTP id j17-20020a05651231d100b0047f5d391d9dmr11716185lfe.140.1656751800079; Sat, 02 Jul 2022 01:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656751800; cv=none; d=google.com; s=arc-20160816; b=RAjjuhtxFUKGPzYNPKP6JqPfKsRIYOTlQof8wsbh0FBrni8ENDY8niBG6hWI/Xzo3b 3gQi7J/7ZeI/mHZWkrJ6NdgAkiTG2G0cVy32iA74DHCoEOGh1hUADgtBVf0xipHFiq4m Rff00GV24IkUhA+mLWn+498b3W0hyKtL7jW2yXxJx34EuD0lnfso9sE64g+htPxtPLqg jzggxWr3mTxUHzxVc9i/YqEQsLm9w0lVW9OLEj2Yai/+CQLIkA4Q9jECaLqLatKjyCYo NiW87apjn7z6jq1VD/IORWmcadzdSM+ugtCKVVzmomzwiO5bTg7JGL+w3otRWkGFDsOT LB1g== 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=gCerskd3Om9nHS3nEaolQFqBR99uhxzxKLmMt0GeYYc=; b=JrR3/f2YqCuBBFT+Wv7pFAXZag/2zPYOk0PlxJ9t1CM0wzf11+jyspVmlYeGTD+/vv I70zuzQjjEH0dTtkm+7OhnVYkFj04p3ZkwSAKYErOrN86/E2mvCJJv0Y/4O5ed6LPGP6 KMeuROYbT6/rrQyXi07G+8uKBZ2viKLeRe44uhF8rm+8YqTbqdKFKo/64XGJqI53gTP9 AFFCrPwUudQEPGq04uuD4WoigitL1N+MP8cruf1VSmSm4CvhZhrq/tkT0OxDayqAM0fe jtDKaOPmARXTvha0xtdo2K0DPHQHYsq/c62lGrqH5YkvOBAOVAtBJ27F42w01m0i3kSh nb7Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="pe7ES9t/"; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com. [2a00:1450:4864:20::62e]) by gmr-mx.google.com with ESMTPS id o9-20020ac25e29000000b0047f8e0add59si1151957lfg.10.2022.07.02.01.50.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Jul 2022 01:50:00 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::62e as permitted sender) client-ip=2a00:1450:4864:20::62e; Original-Received: by mail-ej1-x62e.google.com with SMTP id fi2so7886057ejb.9 for ; Sat, 02 Jul 2022 01:50:00 -0700 (PDT) X-Received: by 2002:a17:907:7f22:b0:726:8962:d5a6 with SMTP id qf34-20020a1709077f2200b007268962d5a6mr18493336ejc.717.1656751799409; Sat, 02 Jul 2022 01:49:59 -0700 (PDT) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="pe7ES9t/"; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=melroch-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:30905 Archived-At: --0000000000007c227705e2ce96bf Content-Type: text/plain; charset="UTF-8" I use this Lua filter to clean up when I convert from DOCX. ``````lua local function handler (elem) -- Get the length of the content len = #elem.content -- Check that the content isn't empty if 0 < len then -- Is the last child a space? if 'Space' == elem.content[len].tag then -- Remove the space (last child) elem.content:remove() -- Return a space *after* the element return { elem, pandoc.Space() } end end return nil end return { { Emph = handler, Strong = handler, Strikeout = handler, SmallCaps = handler, Underline = handler, Span = handler, Link = handler, } } `````` Den fre 1 juli 2022 18:37r.d.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org skrev: > I am a bit sloppy typing italics in my wordprocessor, and generally only > turn off the italics after I hit the space at the end of the word, so I end > up with markdown output that looks like this (when I convert from rtf to > md): > > Strictly speaking the qualities that are imposed by the *logos *of a > certain thing are the *activities *of the *logos* > > This looks ugly when I open it up in Emacs etc. I can fix these with regex > replace in Emacs; but I thought pandoc had normalization by default now, > which is supposed to fix these kinds of stylistic errors? I tried passing > the markdown again through pandoc, to generate markdown, but it made no > difference. > > -- > 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/bd84993b-b1cd-4128-aab2-ce1eff2c9768n%40googlegroups.com > > . > -- 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/CADAJKhCj%3DdCQ%2B1BkzkK7%2B%2BbJn8ajpKkbxYHYVrHaC_NRjVQ15Q%40mail.gmail.com. --0000000000007c227705e2ce96bf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I use this Lua filter to clean up when I convert from DOC= X.

``````lua
local function handler (elem)
=C2=A0 -- Get the length of the content
=C2=A0 len =3D #elem.content
=C2=A0 -- Che= ck that the content isn't empty
=C2=A0 if 0 <= len then
=C2=A0 =C2=A0 -- Is the last child a space= ?
=C2=A0 =C2=A0 if 'Space' =3D=3D elem.conte= nt[len].tag then
=C2=A0 =C2=A0 =C2=A0 -- Remove the = space (last child)
=C2=A0 =C2=A0 =C2=A0 elem.content= :remove()
=C2=A0 =C2=A0 =C2=A0 -- Return a space *af= ter* the element
=C2=A0 =C2=A0 =C2=A0 return { elem,= pandoc.Space() }
=C2=A0 =C2=A0 end
=C2=A0 end
=C2=A0 return nil
end

return {
=C2=A0 {
=C2=A0 =C2=A0 Emph=C2=A0= =C2=A0 =C2=A0 =3D handler,
=C2=A0 =C2=A0 Strong=C2= =A0 =C2=A0 =3D handler,
=C2=A0 =C2=A0 Strikeout =3D = handler,
=C2=A0 =C2=A0 SmallCaps =3D handler,
<= div dir=3D"auto">=C2=A0 =C2=A0 Underline =3D handler,
=C2=A0 =C2=A0 Span=C2=A0 =C2=A0 =C2=A0 =3D handler,
=C2=A0 =C2=A0 Link=C2=A0 =C2=A0 =C2=A0 =3D handler,
=C2=A0 }
}
``````

--
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:/= /groups.google.com/d/msgid/pandoc-discuss/CADAJKhCj%3DdCQ%2B1BkzkK7%2B%2BbJ= n8ajpKkbxYHYVrHaC_NRjVQ15Q%40mail.gmail.com.
--0000000000007c227705e2ce96bf--