From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31844 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.text.pandoc Subject: AW: How do I replace a string in all text that pandoc converts, i.e. how do I do this with a filter? Date: Mon, 5 Dec 2022 22:56:32 +0000 Message-ID: <24509d5ca5844dbda07b3e77d86ab3f4@unibe.ch> References: <83eeff5c-8fc3-4ca3-862c-bb85790daabcn@googlegroups.com> <3ae58adb-8789-4398-8ab0-fe1e6928e292n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_24509d5ca5844dbda07b3e77d86ab3f4unibech_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24457"; mail-complaints-to="usenet@ciao.gmane.io" To: Original-X-From: pandoc-discuss+bncBCZ27W53TUFBBI7OXGOAMGQEDNOEB3Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Dec 05 23:56:39 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ej1-f64.google.com ([209.85.218.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2KO7-0006Cs-JQ for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 05 Dec 2022 23:56:39 +0100 Original-Received: by mail-ej1-f64.google.com with SMTP id xh12-20020a170906da8c00b007413144e87fsf418072ejb.14 for ; Mon, 05 Dec 2022 14:56:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670280999; cv=pass; d=google.com; s=arc-20160816; b=WeDRoXEMo1N0wwBGmdaqvntHvSfO4janCbHOJjpEUi2QEHOPJKKt5HeDBPFJzQjwlO qHs4RhHOF3HXT1d7joRzjcwey56v+ly/2yeMw1ZJtuMr4LU/qah194NE2hgVNFLR3wLL 71KThzw5APJyzwagQpe64N8s2kjZ+eiq1SP6cPj3cPKiHG+l+F91QfRzcr8RSz5x+P6q htgBqSczx3/s31ac4v+JagES0XhhjDRDJE5JLuAg6iwq5EtjXKb2LRBjgEekcN+YmdQT EPqqvLpGkYPsO/v71YMZoffJLl8miNGHs6SMkX/PNC0ski9mAIiARmF1FlX5khrbrGjC sYdg== 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:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:sender :dkim-signature; bh=6lKsJaBf+hLMSz3a3ulzOJwopoixetJbGLAFC3uwARI=; b=AfY3u9IJVyy3hYueRnvMZSxP2fT1HRwcNrpG15XBiMU2f9QWeOycWaRYnE4JhEipQY ZBxcj2IcTL0MIOSUfqSrcJPRSIRGQtRjPJ5ZAIcZVkZWUSUTUnRqJf2m4i4wXsoosZMf qfzZlA4xqk/3gtYe+0ZrUDP3Jp1NSFjY0LRSzqqqlg2/I5QloW/Xr30ZyM47x+freXiH lufiIYdiL7kcwNPzc6OcLvvxisM2AE3vwA3KcUumgJ0v4Ouhafyua0S4h1JCQMmcV7Yi mzza65SGLRuVJc1fl2GMsCoYASnsBGkKedQDO9ruo7q2oH0qbOnk/T9am7x+xd21i9Yi /U7Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@unibe.ch header.s=mgwsel1 header.b="HIrG/1Eb"; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.84 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=6lKsJaBf+hLMSz3a3ulzOJwopoixetJbGLAFC3uwARI=; b=hIRKNk6uZFvCw0H9aAy3V4xyKQkt2Jv2DZJekmNebv0Lxq90ERdLJo02rdkh79NiOG 0ibRe2S13BxjpQBrTb3BXfQUg/ZDGQGYKoQZk+Ic+ZzmpaR3oihVLcrKIpPX+TyMGF7I 3Cef/s+dU442+7eTBZjr/S6rkJFfiwusVNc1LtafKQiEmNYtuuZ0HdPNvJF6s+JEawyj oz5+54i3n+lmBJHsTBU48tUdba1VZiQN/05CexSg/Nc3lVYmA9Ac3FVQKDzsuOwWYTMm bGexqV8ay1rj9x3ISfGH+QEyTn7SbTIg X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=6lKsJaBf+hLMSz3a3ulzOJwopoixetJbGLAFC3uwARI=; b=WwQRf9SPNGwjmAgIEvAHndlS54VBuuBVhbnLxrZnO5oou33m/gFVHxlpBGYD1Wfcpe LNn10SDAxrKP8UJYL4XlrRHdGZkg0BnnYFphRJ7OgbqdMqa23SxI1W/aZV+J59mBKzpX OEWsBOvHdIvEH2OTT9nCjGW//0LoxRpM5BgWQxNakSJTFmHmb3RRZV75qD7BQF/AWwDg +p1S36llI4e4n7gRY34Peo+AohGmSdN4U9eZGkLVlrSGmTt8DxARGgjTz3PFc6UIq Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5plqT7oLQjysIElhgbXrkgP8AArgM3s9SkCBxnCTcD9vuXc6Jdm8 7OXdckhV/hXSa27kRWCivyM= X-Google-Smtp-Source: AA0mqf7xlvHcEzFemGlFTY/68SNDz2hTmmqSTkPOGRZrrcTy/ob9YsPVHXoqUKCffNaiGhmuOXo23w== X-Received: by 2002:a17:906:444b:b0:7ad:dd43:5d53 with SMTP id i11-20020a170906444b00b007addd435d53mr52791358ejp.376.1670280999021; Mon, 05 Dec 2022 14:56:39 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:906:1b1a:b0:780:f131:b4d9 with SMTP id o26-20020a1709061b1a00b00780f131b4d9ls3178950ejg.11.-pod-prod-gmail; Mon, 05 Dec 2022 14:56:34 -0800 (PST) X-Received: by 2002:a17:906:c44a:b0:7c0:d6bb:fd7 with SMTP id ck10-20020a170906c44a00b007c0d6bb0fd7mr9852926ejb.726.1670280994673; Mon, 05 Dec 2022 14:56:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670280994; cv=none; d=google.com; s=arc-20160816; b=WGtjDTpg1ASPh121hQX+HcsjxlB6coEbzR0QykwolNO1lgmMoim/52pRFgv7r5hQIV cpxuqPaE+X1WtCmfDzA1cBusO4/w8Zt18U9HSAlb8UdCNUf1gBQ1hZm/B10AfVAw6RRb n1MAqe/s2kqwv4lqZhfpCFX8xa89PhiBYYmXPrw0fjZ6Q9p00hEroHUElhQP0RSqXd+d 2GI3wD5oG4SAsrdQ9jqe8pD5oCuRw7WpsqVQxGAivq4fRv5pRQft+CPEmMZfgaMD+K4q bexrBetzaUVKwer8H0J2u6b+s7besrdC2mXgf3XdBZPJ53+Vq4gN16SCBIgsXzm2kq5z nfyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:to :from:dkim-signature; bh=z0OgLyYvQCs3Nf60whYIf0k1HhBAL0AtoExA6+YGabc=; b=F4YSBOezZvu/ugwWiwYgsfCdo+AZr1P+ZU2xBPJJ5opqN/cmPURPJhRpgoeHfZtDrk wpEKvKZSndugCiVaAngsi4iCtX5mjbcDdQNPV0UTCRx3JDuC4Jzaet+kfG+AlFmNf5pb qWRZ32UHFQokE6UEK7L30VxBQXU0gMncNHzQusUws0AVeUhEkeGwWQrmh4gSp+AP9TMM mZe0OaAPdRWvd/cl3cSz0aqtc+7fuOG5zjE7w+UHC1NmKg4ySVAheSeOQmAT8pdsfvvk Gt8NO0HHemlhFFoTcMTdEX+exUljCpcoAoo7Ei+H9UvtjopratYwFJVPXsq2I6M1jLKp Kp8A== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@unibe.ch header.s=mgwsel1 header.b="HIrG/1Eb"; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.84 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch Original-Received: from mailhub-lb3.unibe.ch (mailhub-lb3.unibe.ch. [130.92.0.84]) by gmr-mx.google.com with ESMTPS id y5-20020a50e605000000b0045a1a4ee8d3si38381edm.0.2022.12.05.14.56.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Dec 2022 14:56:34 -0800 (PST) Received-SPF: pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.84 as permitted sender) client-ip=130.92.0.84; X-Virus-Scanned: By University of Bern - MGW Original-Received: from mail.campus.unibe.ch (aai-edge-04.campus.unibe.ch [130.92.13.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailhub-lb3.unibe.ch (Postfix) with ESMTPS id 6FDF650008F for ; Mon, 5 Dec 2022 23:56:33 +0100 (CET) Original-Received: from aai-mail-02.campus.unibe.ch (130.92.13.168) by AAI-EDGE-04.campus.unibe.ch (130.92.13.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.1.2507.16; Mon, 5 Dec 2022 23:56:31 +0100 Original-Received: from aai-mail-03.campus.unibe.ch (130.92.13.41) by aai-mail-02.campus.unibe.ch (130.92.13.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.1.2507.16; Mon, 5 Dec 2022 23:56:33 +0100 Original-Received: from aai-mail-03.campus.unibe.ch ([172.18.73.17]) by aai-mail-03.campus.unibe.ch ([172.18.73.17]) with mapi id 15.01.2507.016; Mon, 5 Dec 2022 23:56:32 +0100 Thread-Topic: How do I replace a string in all text that pandoc converts, i.e. how do I do this with a filter? Thread-Index: AQHZCNHjf/ZLvnEKSku8rNPhS+hfuK5fg9cAgABjBzA= In-Reply-To: <3ae58adb-8789-4398-8ab0-fe1e6928e292n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Accept-Language: de-CH, en-US Content-Language: de-DE x-originating-ip: [130.92.13.161] X-Original-Sender: denis.maier-NSENcxR/0n0@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@unibe.ch header.s=mgwsel1 header.b="HIrG/1Eb"; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.84 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch 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:31844 Archived-At: --_000_24509d5ca5844dbda07b3e77d86ab3f4unibech_ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable What exactly are you doing? Your output format is html? I=E2=80=99ve just t= ested this and it seems to work. ```cmd C:\Users\denis\Downloads\filter>cat test.md asf {{helloworld}} asf C:\Users\denis\Downloads\filter>pandoc test.md

asf

{{helloworld}}

asf

C:\Users\denis\Downloads\filter>pandoc test.md -L filter.lua

asf

abc

asf

``` Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Im A= uftrag von paulschillinger93-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Gesendet: Montag, 5. Dezember 2022 18:58 An: pandoc-discuss Betreff: Re: How do I replace a string in all text that pandoc converts, i.= e. how do I do this with a filter? I've tried this: return { { Para =3D function (elem) if elem.content[1].text =3D=3D "{{helloworld}}" then return pandoc.RawBlock('html','
abc
') else return elem end end, } } but that only gets rid of {{helloworld}}, it doesn't replace it with anythi= ng. Sadly this doens't work for "=3D=3D", i.e. those don't disappear. On Monday, December 5, 2022 at 6:49:08 p.m. UTC+1 - wrote: I've been trying to replace markdown/Obsidian highlights "=3D=3D" either wi= th something that LaTeX can use e.g. \hl or just delete it/replace it with = nothing, but I can't figure out how to do this. I've tried this: function Str (str) str.text =3D string.upper(str.text) return str end But I can't even figure out where I'm meant to put my own text? How do I rpelace =3D=3D with " "? Thanks! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/3ae58adb-8789-4398-8ab0-fe1e6928e292n%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/24509d5ca5844dbda07b3e77d86ab3f4%40unibe.ch. --_000_24509d5ca5844dbda07b3e77d86ab3f4unibech_ Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

What exactly are you doing? Your output format is html? I=E2=80=99ve just tested = this and it seems to work.

&nbs= p;

```cmd

C:\Users\= denis\Downloads\filter>cat test.md

asf<= /o:p>

&nbs= p;

{{hellowo= rld}}

&nbs= p;

asf<= /o:p>

C:\Users\= denis\Downloads\filter>pandoc test.md

<p>= asf</p>

<p>= {{helloworld}}</p>

<p>= asf</p>

&nbs= p;

C:\Users\= denis\Downloads\filter>pandoc test.md -L filter.lua

<p>= asf</p>

<div&g= t;abc</div>

<p>= asf</p>

```

Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von paulschillinger93-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Gesendet: Montag, 5. Dezember 2022 18:58
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: How do I replace a string in all text that pandoc conve= rts, i.e. how do I do this with a filter?

 

I've tried this:

 

return {
  {
    Para =3D function (elem)
      if elem.content[1].text =3D=3D "{{helloworld}}&qu= ot; then
        return pandoc.RawBlock('html','<div>abc&l= t;/div>')
      else
        return elem
      end
    end,
  }
}

 

but that only gets rid of {{helloworld}}, it doesn't= replace it with anything. Sadly this doens't work for "=3D=3D", = i.e. those don't disappear.

On Monday, December 5, 2022 at 6:49:08 p.m. UTC+= 1 - wrote:

I've been trying to replace markdown/Obsidian highli= ghts "=3D=3D" either with something that LaTeX can use e.g. \hl o= r just delete it/replace it with nothing, but I can't figure out how to do = this.

 

I've tried this:

function Str (str) 

str.text =3D string.upper(str.text)

return str

end

 

But I can't even figure out where I'm meant to put m= y own text?

 

How do I rpelace =3D=3D with " "?

 

Thanks!

--
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 pandoc-d= iscuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3ae58adb-8789-4398-8ab0-fe= 1e6928e292n%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://groups.google.com/d/msgid/pandoc= -discuss/24509d5ca5844dbda07b3e77d86ab3f4%40unibe.ch.
--_000_24509d5ca5844dbda07b3e77d86ab3f4unibech_--