From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31854 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: - Newsgroups: gmane.text.pandoc Subject: Re: How do I replace a string in all text that pandoc converts, i.e. how do I do this with a filter? Date: Tue, 6 Dec 2022 02:55:17 -0800 (PST) Message-ID: References: <83eeff5c-8fc3-4ca3-862c-bb85790daabcn@googlegroups.com> <3ae58adb-8789-4398-8ab0-fe1e6928e292n@googlegroups.com> <24509d5ca5844dbda07b3e77d86ab3f4@unibe.ch> <2faac96e448d4303b3ea0e12ef05dfbe@unibe.ch> <7cabb17e-9a2b-4251-bd95-c5415140c9adn@googlegroups.com> <272ed09b-4245-4128-94a2-50cf5f67e10dn@googlegroups.com> <6d25bb08-224d-4f01-8eba-3f1c55d19e83n@googlegroups.com> <3db81523c80944f3a81a18f25166124f@unibe.ch> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_5756_522041632.1670324117706" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39008"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDR3RNPJ3YORBF57XSOAMGQEZGXTZYQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Dec 06 11:55:23 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f58.google.com ([209.85.210.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2Vbf-0009u0-0f for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 06 Dec 2022 11:55:23 +0100 Original-Received: by mail-ot1-f58.google.com with SMTP id e5-20020a0568301e4500b0066e7236e566sf8292393otj.23 for ; Tue, 06 Dec 2022 02:55:22 -0800 (PST) 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-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=uyi00q1NoIzZ5pZVxny1F+wpnyW5w6/8+4n5a3TSnkA=; b=i+jr2ty0G0zNHhMaNDx3lYyxwtXyoKJ2lD+P8j0QEzi/RIQ126Kn6td4LTOzkLlVSr hDauC86t7g7hNFlHMO0zM+NHMyAi/3MgRE0AVYrmn9oMl7m6gjUtXqvPFoIxVEnrfBnG 6MYVvOFFD8mkrvqfYE7UFZGJ3xcRbUcibDMNlSTqi1EkhK8ECI6sa8YDFgphRd0+bC2Z 4vN2IINZKCl0+EXiTu06VSPjRmSFk+q/7cQZXe3HpHZyYlUc5XPtgi4YEfEzJYaLp2Vj Hb3vak30ETJLO0gkIfIiJEP3kNBY7aXvqGnHX+9DFeG80f3x4TMshA1KeiDKn8igAl4P xAUQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=uyi00q1NoIzZ5pZVxny1F+wpnyW5w6/8+4n5a3TSnkA=; b=SjvKxmBkd8fd5qKV9IBY3W/hqlWdqqruXhXXyZoHFgV9XXY7lJXX7YWjlawioUXUSB 62wjXDo93jj/Ikwq5b1mVhB9QZPrvpCP4egfPXJBwgHCcZb/iWZevvbRx5V07DhyNBED X7G7sgzufYTiXh2U5RLjHPf8DQwYZaQ70IpMTojpirAXt8A7tD8sS5xdzVrHUcrnxr5x kaSSTIPdDFPmy/QY73seRit1/raguDZBtxUF1FH08r+ZpSgcJ1tF9usKc3P7iy/tj38f s0lXyPmVyxX3uEgLRsvyoM591TzEzishRS46BV5a6647CnyjZ/CzXDIKHshvneokQZwg rAsw== 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-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=uyi00q1NoIzZ5pZVxny1F+wpnyW5w6/8+4n5a3TSnkA=; b=UCwIAyktAy5Buvl5XGgmzkuVvuBFmytncIkEasbg5wDD7LindtX0S2/vxYZ708WGfL n7F3uaUS3hyGepUxyyXrgc2gYjehVYomJFBiMNxDXyKtQVci98IcuIs41DyPGwSGYqrq +ohONowX1/PVC8X+QIDvT0QxK5mNyMY7yyQz1ZpE7Yb8mWspvek1CWgg9LudX1qmiylZ K1q1PCKwK7X2j2bQZSYFIDrjeqgjaQ6XEfVFlBYQ2RHBQYkFnTylcQaCN2Tt0dxFzqBU giZgCw+n3hiUkpUZZkz68yEkCzoSZE21Ed2t3tOrBgIAo18VJpmsonDRMSSo+vffSTKK cKwA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pks8dXhZREztX4IxBLvbWCcH+RUraPiBWlnmZo95YOlr0PWukkR /NPh+GZCZPxBqYq+NC0Cp5c= X-Google-Smtp-Source: AA0mqf5fif9WRnxXIbbn4ZYl2VTmjm/KLhC/Gtsyku9t96HomAyVTM/pdtgJXjNQWKaIk3KhelM1dg== X-Received: by 2002:a05:6871:4684:b0:141:c076:de4c with SMTP id ni4-20020a056871468400b00141c076de4cmr51847711oab.248.1670324121765; Tue, 06 Dec 2022 02:55:21 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a54:4e08:0:b0:35a:6687:ef26 with SMTP id a8-20020a544e08000000b0035a6687ef26ls2217088oiy.4.-pod-prod-gmail; Tue, 06 Dec 2022 02:55:18 -0800 (PST) X-Received: by 2002:aca:6107:0:b0:35b:4bd8:6833 with SMTP id v7-20020aca6107000000b0035b4bd86833mr35695588oib.104.1670324118528; Tue, 06 Dec 2022 02:55:18 -0800 (PST) In-Reply-To: <3db81523c80944f3a81a18f25166124f-NSENcxR/0n0@public.gmane.org> X-Original-Sender: paulschillinger93-Re5JQEeQqe8AvxtiuMwx3w@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:31854 Archived-At: ------=_Part_5756_522041632.1670324117706 Content-Type: multipart/alternative; boundary="----=_Part_5757_1526945424.1670324117706" ------=_Part_5757_1526945424.1670324117706 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable OK, so I have markdown text that includes =3D=3Dhighlighted=3D=3D words lik= e that.=20 I would like to convert =3D=3Dhighlighting=3D=3D either to \hl{highlighting= } so=20 LaTeX can handle it, or to highlighting, i.e. remove the symbols, so that= =20 they just don't appear. Thanks to you, I now have a working filter that looks like this: return { { Str =3D function (elem) if elem.text =3D=3D "highlighting" then return pandoc.Emph {pandoc.Str "highlighting"} else return elem end end, } } This filter takes all instances of highlighting and turns them into=20 *highlighting*. However, ONLY if that's a whole word. If it's=20 =3D=3Dhighlighting=3D=3D it doesn't touch it because that's seemingly techn= ically=20 another word as it contains other characters. In my case I would like to=20 replace only the "=3D=3D" but since they're attached to other characters, i= .e.=20 the actual word, the filter doesn't touch them. That's where I'm at right now. I'm now looking for a modification of that= =20 filter so it also applies to parts of a word. Any ideas on that? Thanks! On Tuesday, December 6, 2022 at 11:00:09 a.m. UTC+1 denis...-NSENcxR/0n0@public.gmane.org wrote= : > Sorry, I haven=E2=80=99t been following from the beginning. Can you provi= de a=20 > complete example. What=E2=80=99s your input ? What=E2=80=99s the desired = output ? > > =20 > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im=20 > Auftrag von *paulschi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > *Gesendet:* Dienstag, 6. Dezember 2022 01:03 > *An:* pandoc-discuss > *Betreff:* Re: How do I replace a string in all text that pandoc=20 > converts, i.e. how do I do this with a filter? > > =20 > > I've narrowed it down! The issue isn't the characters but that they're=20 > technically "part" of the word. How do I replace PART of a word? > > Thanks! > > =20 > > On Tuesday, December 6, 2022 at 12:52:05 a.m. UTC+1 - wrote: > > Barring that, can't I use something like "> =3D string.gsub("Hello banana= ",=20 > "banana", "Lua user")", if so how would I do that? I got that example fro= m=20 > http://lua-users.org/wiki/StringLibraryTutorial > > On Tuesday, December 6, 2022 at 12:51:09 a.m. UTC+1 - wrote: > > I just tried that, thanks! That works :) But this doesn't appear to work= =20 > for characters, like "=3D=3D" which was the original goal. Am I missing s= ome=20 > sort of escape characters? > > On Tuesday, December 6, 2022 at 12:49:46 a.m. UTC+1 denis...-NSENcxR/0n0@public.gmane.org=20 > wrote: > > You are matching against the whole paragraph (para). So, when the first= =20 > element in your paragraph matches your search string, you'll replace the= =20 > whole paragraph with the return value of your function. (Which is a block= =20 > element, not an inline element.)=20 > > Use the example from here instead:=20 > https://pandoc.org/lua-filters.html#macro-substitution=20 > ________________________________________=20 > Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org im Auftrag= =20 > von paulschi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org =20 > Gesendet: Dienstag, 6. Dezember 2022 00:32:23=20 > An: pandoc-discuss=20 > Betreff: Re: How do I replace a string in all text that pandoc converts,= =20 > i.e. how do I do this with a filter?=20 > > YES! that works! But can you tell me why it replaces the whole line? Can'= t=20 > I do this in running text?=20 > Thanks!=20 > return {=20 > {=20 > Para =3D function (elem)=20 > if elem.content[1].text =3D=3D "{{helloworld}}" then=20 > return pandoc.RawBlock('latex','abc')=20 > else=20 > return elem=20 > end=20 > end,=20 > }=20 > }=20 > > > > > On Tuesday, December 6, 2022 at 12:09:13 a.m. UTC+1 denis...-NSENcxR/0n0@public.gmane.org=20 > wrote:=20 > Just your example filter:=20 > > ```lua=20 > return {=20 > {=20 > Para =3D function (elem)=20 > if elem.content[1].text =3D=3D "{{helloworld}}" then=20 > return pandoc.RawBlock('html','
abc
')=20 > else=20 > return elem=20 > end=20 > end,=20 > }=20 > }=20 > ```=20 > > The problematic line is this: return=20 > pandoc.RawBlock('html','
abc
')=20 > This adds a raw block that will only come in to effect when your output= =20 > format is html.=20 > > If your target ist latex, you=E2=80=99ll need something like this: return= =20 > pandoc.RawBlock('latex','\\whatever{abc}')=20 > > ```cmd=20 > pandoc test.md -L filter.lua -t latex=20 > asf=20 > > \whatever{abc}=20 > > asf=20 > ```=20 > > > Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Im Auftrag= =20 > von paulschi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org=20 > Gesendet: Dienstag, 6. Dezember 2022 00:04=20 > An: pandoc-discuss =20 > Betreff: Re: How do I replace a string in all text that pandoc converts,= =20 > i.e. how do I do this with a filter?=20 > > No, my intended output is a PDF file. Does that change anything? Could yo= u=20 > tell me what exactly you put in filter.lua?=20 > Thanks!=20 > > On Monday, December 5, 2022 at 11:56:39 p.m. UTC+1 denis...-NSENcxR/0n0@public.gmane.org=20 > wrote:=20 > What exactly are you doing? Your output format is html? I=E2=80=99ve just= tested=20 > this and it seems to work.=20 > > ```cmd=20 > C:\Users\denis\Downloads\filter>cat test.md=20 > asf=20 > > {{helloworld}}=20 > > asf=20 > C:\Users\denis\Downloads\filter>pandoc test.md=20 >

asf

=20 >

{{helloworld}}

=20 >

asf

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

asf

=20 >
abc
=20 >

asf

=20 > ```=20 > Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Im Auftrag= =20 > von paulschi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org=20 > Gesendet: Montag, 5. Dezember 2022 18:58=20 > An: pandoc-discuss =20 > Betreff: Re: How do I replace a string in all text that pandoc converts,= =20 > i.e. how do I do this with a filter?=20 > > I've tried this:=20 > > return {=20 > {=20 > Para =3D function (elem)=20 > if elem.content[1].text =3D=3D "{{helloworld}}" then=20 > return pandoc.RawBlock('html','
abc
')=20 > else=20 > return elem=20 > end=20 > end,=20 > }=20 > }=20 > > but that only gets rid of {{helloworld}}, it doesn't replace it with=20 > anything. Sadly this doens't work for "=3D=3D", i.e. those don't disappea= r.=20 > On Monday, December 5, 2022 at 6:49:08 p.m. UTC+1 - wrote:=20 > I've been trying to replace markdown/Obsidian highlights "=3D=3D" either = with=20 > something that LaTeX can use e.g. \hl or just delete it/replace it with= =20 > nothing, but I can't figure out how to do this.=20 > > I've tried this:=20 > function Str (str)=20 > str.text =3D string.upper(str.text)=20 > return str=20 > end=20 > > But I can't even figure out where I'm meant to put my own text?=20 > > How do I rpelace =3D=3D with " "?=20 > > Thanks!=20 > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group.=20 > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/3ae58adb-8789-4398-8ab0-= fe1e6928e292n%40googlegroups.com > < > https://groups.google.com/d/msgid/pandoc-discuss/3ae58adb-8789-4398-8ab0-= fe1e6928e292n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>.= =20 > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group.=20 > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/e9cb34ca-b760-4ef6-9432-= 91d37f5e45c5n%40googlegroups.com > < > https://groups.google.com/d/msgid/pandoc-discuss/e9cb34ca-b760-4ef6-9432-= 91d37f5e45c5n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>.= =20 > > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group.=20 > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to=20 > pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.=20 > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/7cabb17e-9a2b-4251-bd95-= c5415140c9adn%40googlegroups.com > < > https://groups.google.com/d/msgid/pandoc-discuss/7cabb17e-9a2b-4251-bd95-= c5415140c9adn%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>.= =20 > > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/6d25bb08-224d-4f01-8eba-= 3f1c55d19e83n%40googlegroups.com=20 > > . > --=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/aedaf371-8dc3-4585-a16c-b4ef55967a7dn%40googlegroups.com. ------=_Part_5757_1526945424.1670324117706 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
OK, so I have markdown text that includes =3D=3Dhighlighted=3D=3D word= s like that. I would like to convert =3D=3Dhighlighting=3D=3D either to \hl= {highlighting} so LaTeX can handle it, or to highlighting, i.e. remove the = symbols, so that they just don't appear.

Thanks to= you, I now have a working filter that looks like this:

return {
  {
    Str =3D function (elem)
&nbs= p;     if elem.text =3D=3D "highlighting" then
    &= nbsp;   return pandoc.Emph {pandoc.Str "highlighting"}
   = ;   else
        return elem
    &= nbsp; end
    end,
  }
}

T= his filter takes all instances of highlighting and turns them into highl= ighting. However, ONLY if that's a whole word. If it's =3D=3Dhighlighti= ng=3D=3D it doesn't touch it because that's seemingly technically another w= ord as it contains other characters. In my case I would like to replace onl= y the "=3D=3D" but since they're attached to other characters, i.e. the act= ual word, the filter doesn't touch them.

That's wh= ere I'm at right now. I'm now looking for a modification of that filter so = it also applies to parts of a word.
Any ideas on that?
<= div>
Thanks!

On Tuesday, December 6, 2022 at 11:00:09 a.m= . UTC+1 denis...-NSENcxR/0n0@public.gmane.org wrote:

Sorry, I haven=E2=80=99t been following from t= he beginning. Can you provide a complete example. What=E2=80= =99s your input=C2=A0? What=E2=80=99s the desired output=C2=A0?

=C2=A0

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...@googlegroups.c= om> Im Auftrag von paulschi..= .@gmail.com
Gesendet: Dienstag, 6. Dezember 2022 01:03
An: pandoc-discuss <pa= ndoc-...-/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?

=C2=A0

I've narrowed it down! The issue isn't the c= haracters but that they're technically "part" of the word. Ho= w do I replace PART of a word?

Thanks!

=C2=A0

On Tuesday, December 6, 2022 at 12:52:05 a.m. UTC+1 = - wrote:

Barring that, can'= ;t I use something like "> =3D string.gsub("Hello banana"= , "banana", "Lua user")", if so how would I do tha= t? I got that example from http://lua-users.org/wiki/StringLibraryTutorial

On Tuesday, December 6, 2022 at 12:51:09 a.m. UTC+1 = - wrote:

I just tried that, th= anks! That works :) But this doesn't appear to work for characters, lik= e "=3D=3D" which was the original goal. Am I missing some sort of= escape characters?

On Tuesday, December 6, 2022 at 12:49:46 a.m. UTC+1 = denis...-NSENcxR/0n0@public.gmane.org wrote:

You are matching against the whole paragraph (para).= So, when the first element in your paragraph matches your search string, y= ou'll replace the whole paragraph with the return value of your functio= n. (Which is a block element, not an inline element.)

Use the example from here instead:
https://pandoc.org/lua-filters.html#macro-substitution
________________________________________
Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org= <pandoc-...@googlegroups= .com> im Auftrag von paulschi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <paulschi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Gesendet: Dienstag, 6. Dezember 2022 00:32:23
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?

YES! that works! But can you tell me why it replaces the whole line? Can= 9;t I do this in running text?
Thanks!
return {
{
Para =3D function (elem)
if elem.content[1].text =3D=3D "{{helloworld}}" then
return pandoc.RawBlock('latex','abc')
else
return elem
end
end,
}
}




On Tuesday, December 6, 2022 at 12:09:13 a.m. UTC+1 denis...-NSENcxR/0n0@public.gmane.org wrote:
Just your example filter:

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

The problematic line is this: return pandoc.RawBlock('html','&l= t;div>abc</div>')
This adds a raw block that will only come in to effect when your output for= mat is html.

If your target ist latex, you=E2=80=99ll need something like this: return p= andoc.RawBlock('latex','\\whatever{abc}')

```cmd
pandoc test.md -L filter.lua -t latex
asf

\whatever{abc}

asf
```


Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org= <pandoc-...@googlegroups= .com> Im Auftrag von paulschi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Gesendet: Dienstag, 6. Dezember 2022 00:04
An: pandoc-discuss <pandoc-..= .@googlegroups.com>
Betreff: Re: How do I replace a string in all text that pandoc converts, i.= e. how do I do this with a filter?

No, my intended output is a PDF file. Does that change anything? Could you = tell me what exactly you put in filter.lua?
Thanks!

On Monday, December 5, 2022 at 11:56:39 p.m. UTC+1 denis...-NSENcxR/0n0@public.gmane.org wrote:
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
<p>asf</p>
<p>{{helloworld}}</p>
<p>asf</p>

C:\Users\denis\Downloads\filter>pandoc test.md -L filter.lua
<p>asf</p>
<div>abc</div>
<p>asf</p>
```
Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org= <pandoc-...@googlegroups= .com> Im Auftrag von paulschi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Gesendet: Montag, 5. Dezember 2022 18:58
An: pandoc-discuss <pandoc-..= .@googlegroups.com>
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','<div>abc</div>')=
else
return elem
end
end,
}
}

but that only gets rid of {{helloworld}}, it doesn't replace it with an= ything. Sadly this doens't work for "=3D=3D", i.e. those don&= #39;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&q= uot; either with something that LaTeX can use e.g. \hl or just delete it/re= place 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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3ae58adb-8789-4398-8ab0-fe= 1e6928e292n%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/3ae58adb-878= 9-4398-8ab0-fe1e6928e292n%40googlegroups.com?utm_medium=3Demail&utm_sou= rce=3Dfooter>.
--
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-discus...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e9cb34ca-b760-4ef6-9432-91= d37f5e45c5n%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/e9cb34ca-b76= 0-4ef6-9432-91d37f5e45c5n%40googlegroups.com?utm_medium=3Demail&utm_sou= rce=3Dfooter>.

--
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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discus...@googlegroups.c= om>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7cabb17e-9a2b-4251-bd95-c5= 415140c9adn%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/7cabb17e-9a2= b-4251-bd95-c5415140c9adn%40googlegroups.com?utm_medium=3Demail&utm_sou= rce=3Dfooter>.

--
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-discus...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.

--
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/aedaf371-8dc3-4585-a16c-b4ef55967a7dn%40googlegroups.= com.
------=_Part_5757_1526945424.1670324117706-- ------=_Part_5756_522041632.1670324117706--