From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31845 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: Mon, 5 Dec 2022 15:04:24 -0800 (PST) Message-ID: References: <83eeff5c-8fc3-4ca3-862c-bb85790daabcn@googlegroups.com> <3ae58adb-8789-4398-8ab0-fe1e6928e292n@googlegroups.com> <24509d5ca5844dbda07b3e77d86ab3f4@unibe.ch> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2620_80646811.1670281464447" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22578"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDR3RNPJ3YORB6PRXGOAMGQE6LQYAFQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Dec 06 00:04:32 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f59.google.com ([209.85.161.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2KVh-0005ZP-Mo for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 06 Dec 2022 00:04:29 +0100 Original-Received: by mail-oo1-f59.google.com with SMTP id v10-20020a4a860a000000b00480b3e2b5afsf5014629ooh.12 for ; Mon, 05 Dec 2022 15:04:29 -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=9Uq+XiMaM5D8rDS4EkbN1BlWcBY579T509S4GZQaQ6Y=; b=hqYLWrtY4D1hhEDRb5htY/qYttFJ9WsekNn1o1aG2rB6qfOiQGJZWoYnHBMOJG4FLQ UYwABC5qvLYrjcMrY4SEHe1zXlT+OuigIMDblL/CUmVYR7k3wf2whtnaoQhmU+S4nUqV L9BuIv2I60zJEcm4mFnWPEP75XiB61w/gI6hcXpB17J0rUhcf0F4epWgALe4AMlSD5/F K21HLkin4xhwBUTiOe29DEnsGZz+D63+fiqQRyycMTxmsNnWvMeinXp8o5GcPJF0xBbM JVQgXgcu1DsvwpjQg+1b+mGpMFZpvqIXxywL+FmRjv+DRNfdUEGgrj0AeIEQ2DSqON4t E3+g== 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=9Uq+XiMaM5D8rDS4EkbN1BlWcBY579T509S4GZQaQ6Y=; b=NEt4zjYiIyRhcbjKbtAtcnqhuXrzmJ/13IuSe94hOICJ7FpE6ZkcWR4sBegKW5Hd0j u5h5S0sG5Z+r+2573kZIO051ZKEqkXgTf9l+9Tg/16nTRbrOkxIJsROmq+AHKLjsmnJI YKS6fsMX/hR5l8QvzzAbxOCJ4mCw0GW+VZ6Y2JtwucY53aIuOsBHlZDIQdOkE9Des4QU m/gQeXvKlh0ANbfZLJIcx3pk/gaV39U05DbakRS6+4/3kTzm4XCQC8BFwMBfV8OE6RpU zuVVVEvhJVDQoTom5b2PnlP+m3tf9jzN1d7jyKCeoZFdV1gkMpjS7CdmnLE2p98XDaY0 45cw== 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=9Uq+XiMaM5D8rDS4EkbN1BlWcBY579T509S4GZQaQ6Y=; b=FTXPARM8BSr0uq9qkzi7XNJdeYZOOEaLkfW1kxYS4D45AZUmgSNajoenngmG4g9hkL 7UekoKoS89v0RzR1VnLrYg3IWeYGeUnOE4WQ1G08kDdhvpOFmlMy/N4bICq3vspbwTu6 4ddZel3Oid4STXlIiPefe8BSEdIe4KvBv+kQT3f5XKQC2dMmnh4A8qIOSsBcrQ/bE1cT jfN6owrHiKH8RpOHsgj8cZYhAp34SsUl/Zkr+Ud7Zy1HPa3KFX0sxdy9a7aKzk9flGVM wRRVAIaeZjqmdu3eaZ7DeUMXc3mU1fUc6a9TnsB6xsCCPcyb59oq2pbp0wmrtK3+d6eD Mf4w== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pmrtu5SIxXOnGq/R1G3imO31BktcN3DW/JkSzP7Jn6qGZ06B+Mr vfELB6POy+eKCM2ZlLxgGKM= X-Google-Smtp-Source: AA0mqf4kcQeCoIzESV/UuCj/zc9n6vUElP4lo+2vvR7MIyKyn9rmv4i/YcdjMMS+sQ2WNjoGgLU3hA== X-Received: by 2002:a05:6808:1392:b0:359:b435:4227 with SMTP id c18-20020a056808139200b00359b4354227mr32243942oiw.73.1670281468452; Mon, 05 Dec 2022 15:04:28 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a4a:4514:0:b0:4a0:a297:c48f with SMTP id y20-20020a4a4514000000b004a0a297c48fls250786ooa.10.-pod-prod-gmail; Mon, 05 Dec 2022 15:04:25 -0800 (PST) X-Received: by 2002:a4a:e250:0:b0:4a0:78a0:bb6a with SMTP id c16-20020a4ae250000000b004a078a0bb6amr10714187oot.4.1670281465133; Mon, 05 Dec 2022 15:04:25 -0800 (PST) In-Reply-To: <24509d5ca5844dbda07b3e77d86ab3f4-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:31845 Archived-At: ------=_Part_2620_80646811.1670281464447 Content-Type: multipart/alternative; boundary="----=_Part_2621_1385628058.1670281464447" ------=_Part_2621_1385628058.1670281464447 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable No, my intended output is a PDF file. Does that change anything? Could you= =20 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= tested=20 > this and it seems to work. > > =20 > > ```cmd > > C:\Users\denis\Downloads\filter>cat test.md > > asf > > =20 > > {{helloworld}} > > =20 > > asf > > C:\Users\denis\Downloads\filter>pandoc test.md > >

asf

> >

{{helloworld}}

> >

asf

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

asf

> >
abc
> >

asf

> > ``` > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im=20 > Auftrag von *paulschi...-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=20 > converts, i.e. how do I do this with a filter? > > =20 > > I've tried this:=20 > > =20 > > return { > { > Para =3D function (elem) > if elem.content[1].text =3D=3D "{{helloworld}}" then > return pandoc.RawBlock('html','
abc
') > else > return elem > end > end, > } > } > > =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. > > 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 = 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: > > 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 > 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/3ae58adb-8789-4398-8ab0-= fe1e6928e292n%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/e9cb34ca-b760-4ef6-9432-91d37f5e45c5n%40googlegroups.com. ------=_Part_2621_1385628058.1670281464447 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 M= onday, December 5, 2022 at 11:56:39 p.m. UTC+1 denis...-NSENcxR/0n0@public.gmane.org wrote:

What exactly are you doing? You= r output format is html? I=E2=80=99ve just tested this and it seems to work.<= /u>

=C2=A0

```cmd

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

asf

=C2=A0

{{helloworld}}

=C2=A0

asf

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

<p>asf</p>

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

<p>asf</p>

=C2=A0

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.c= om> Im Auftrag von paulschi..= .@gmail.com
Gesendet: Montag, 5. Dezember 2022 18:58
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 tried this:

=C2=A0

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

=C2=A0

but that only gets rid of {{helloworld}}, it doesn&#= 39;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 hi= ghlights "=3D=3D" either with something that LaTeX can use e.g. \= hl or just delete it/replace it with nothing, but I can't figure out ho= w to do this.

=C2=A0

I've tried this:

function Str (str)=C2=A0

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

return str

end

=C2=A0

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

=C2=A0

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

=C2=A0

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.

--
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/e9cb34ca-b760-4ef6-9432-91d37f5e45c5n%40googlegroups.= com.
------=_Part_2621_1385628058.1670281464447-- ------=_Part_2620_80646811.1670281464447--