From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32398 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pa Sc Newsgroups: gmane.text.pandoc Subject: Re: Help with Lua filter for markdown to LaTeX with Pandoc Date: Sat, 25 Mar 2023 15:01:10 -0700 (PDT) Message-ID: References: <79ac7814-9558-4d49-a682-cf31f970d27dn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4372_1403772000.1679781670335" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38542"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDS5HMVM7MCBBJ667WQAMGQEJEYBAIA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Mar 25 23:01:15 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f56.google.com ([209.85.210.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pgBwp-0009l2-0D for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 25 Mar 2023 23:01:15 +0100 Original-Received: by mail-ot1-f56.google.com with SMTP id k29-20020a9d701d000000b006a037b882d8sf2100959otj.16 for ; Sat, 25 Mar 2023 15:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1679781674; 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=CVqZSyBMntSA5qVVCX++cu5Q7q/8NQi5OGyr0Y0g6pg=; b=ioFMxOEJ9/PCRu8+vnmWiTjAGf5Xj118mtzwwDD/BjP6i1M/HwYwPnCIuFfJOjj/b4 39nQRqB/Ig5AUfcSugXu90tObsj1ucodslEGaM7X5gH3SwjW74Je3RqmvXBuAoTGKCJf 8q9bLtBQwRlQs4IdFBgaiF8RgStXivfqVGHAX4759vIf9cC9pYXONf4dL+x7YQz9x5zr J8g03tuv5dp5ubT7J9X3Ixg14rUxQvFDtrMyZQtDXslpJZfBXpWwqTb66vZh5TrNvPYD kbaIbiRzlA9KadT9+So6xVLib3RQOT8Az+hO8Nn1DXiWAN1u/uaJAy8sYl9aYqXs64al fb2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679781674; 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=CVqZSyBMntSA5qVVCX++cu5Q7q/8NQi5OGyr0Y0g6pg=; b=h7RuK+jqdBEtu82PclTiAOaFbkYkU1th8JtDMYD8WH+XMu7QzAGUXKqWq+2dCOFb0s RFZ8e8lVdFrq/SyE4xlHvz9b9COE5jq9dM29gWf7H93o9BaTdHZ/cQN6oWg5mmw5PmZ4 9fYZS2A4BxSH0jySTx5sxhaFOP5CD0PtEr1mMaYg4AMVb0iYn4v0SYn6FFP4ftKuzKZB uSk4NGgs71LIFzF2Sc078ZyPPMndDnnkyCuHJ4HLvyMcOuq4FuYTwpGSrI6GCi33qpEB TxvWTlhiDRaRDcw97iPX+VT3f4ZbaD6A2CHOhEEcqPDpTKveB0ZfDT5WCtGkJydM3/J+ Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKUDv1EIA/0vuObw9W1MZ+m4ws6X5AU3RQoHtdEW/zYz/kP/YbaO KNMitC8krW2Z/4z8qRETkTE= X-Google-Smtp-Source: AK7set+tQYDZ6djxVS0CYK/1dhq7KIUF+X4i37iNEyMmoTd5rv9Rck3EgM/Czw4gLBNm9eODUz1G9w== X-Received: by 2002:a05:6808:355:b0:387:ee9:9c80 with SMTP id j21-20020a056808035500b003870ee99c80mr1835347oie.7.1679781673886; Sat, 25 Mar 2023 15:01:13 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:198b:b0:387:447d:ee97 with SMTP id bj11-20020a056808198b00b00387447dee97ls1117001oib.8.-pod-prod-gmail; Sat, 25 Mar 2023 15:01:11 -0700 (PDT) X-Received: by 2002:aca:240d:0:b0:388:c626:a331 with SMTP id n13-20020aca240d000000b00388c626a331mr1029877oic.4.1679781671091; Sat, 25 Mar 2023 15:01:11 -0700 (PDT) In-Reply-To: X-Original-Sender: ideas-and-peanutbutter-zqRNUXuvxA0b1SvskN2V4Q@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:32398 Archived-At: ------=_Part_4372_1403772000.1679781670335 Content-Type: multipart/alternative; boundary="----=_Part_4373_1352158090.1679781670335" ------=_Part_4373_1352158090.1679781670335 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I followed that, thanks! But I'm still getting `\emph{\hl{abc}` as the=20 output, any other ideas? Bastien DUMONT schrieb am Samstag, 25. M=C3=A4rz 2023 um 15:38:47 UTC+1: > First, you need to replace `\\hl{` with `\\colorbox{declared-color}{`=20 > (mind the double backslash). Then Span.lua can be replaced with the=20 > following filter acting on emphasized (italicized) pieces of text: > > in-red.lua: > ``` > function Emph (emph) > local content =3D emph.content > if #content =3D=3D 1 > and content[1].t =3D=3D 'Span' > and content[1].classes:includes 'mark-red' then > return { > pandoc.RawInline('latex', '\\colorbox{lightred}{'), > content[1], > pandoc.RawInline('latex', '}') > } > end > end > ``` > > Here, I replaced "mark" with "mark-red" as you suggested because I don't= =20 > remove the Span element, in case it contains other classes or attributes= =20 > that should be processed by other filters or by Pandoc itself. If the Spa= n=20 > was kept with the "mark" class, Pandoc would wrap it in the \hl macro=20 > afterwards. > > Le Saturday 25 March 2023 =C3=A0 05:42:45AM, Pa Sc a =C3=A9crit : > > In markdown (written in Obsidian.md) I use a plugin/theme so that=20 > `*=3D=3Dtext=3D=3D*` > > is rendered as red instead of italic and highlighted. > >=20 > > I use this lua-filter to convert regular `=3D=3Dhighlighting=3D=3D` to = LaTeX `\hl > > {highlighting}` which works perfectly: (I somehow require these two=20 > files, I > > can't remember why) > >=20 > > **highlight.lua**: > > ``` > > --[[ > > Add support for a custom inline syntax. > > This pandoc Lua filter allows to add a custom markup syntax > > extension. It is designed to be adjustable; it should not be > > necessary to modify the code below the separator line. > > The example here allows to add highlighted text by enclosing the > > text with `=3D=3D` on each side. Pandoc supports this for HTML outp= ut > > out of the box. Other outputs will need additional filters. > > Copyright: =C2=A9 2022 Albert Krewinkel > > License: MIT > > ]] > > =20 > > -- Lua pattern matching the opening markup string. > > local opening =3D [[=3D=3D]] > > =20 > > -- Lua pattern matching the closing markup string. > > local closing =3D [[=3D=3D]] > > =20 > > -- Toggle whether the opening markup may be followed by whitespace. > > local nospace =3D true > > =20 > > -- Function converting the enclosed inlines to their internal pando= c > > -- representation. > > local function markup_inlines (inlines) > > return pandoc.Span(inlines, {class=3D"mark"}) > > end > > =20 > > =20 > ------------------------------------------------------------------------ > > =20 > > local function is_space (inline) > > return inline and > > (inline.t =3D=3D 'Space' or > > inline.t =3D=3D 'LineBreak' or > > inline.t =3D=3D 'SoftBreak') > > end > > =20 > > function Inlines (inlines) > > local result =3D pandoc.Inlines{} > > local markup =3D nil > > local start =3D nil > > for i, inline in ipairs(inlines) do > > if inline.tag =3D=3D 'Str' then > > if not markup then > > local first =3D inline.text:match('^' .. opening .. '(.*)') > > if first then > > start =3D inline -- keep element around in case the > > -- markup is not closed. Check if the > > -- closing pattern is already in this > > -- string. > > local selfclosing =3D first:match('(.*)' .. closing .. '$= ') > > if selfclosing then > > result:insert(markup_inlines{pandoc.Str(selfclosing)}) > > elseif nospace and first =3D=3D '' and is_space(inlines[i= +1])=20 > then > > -- the opening pattern is followed by a space, but the > > -- config disallows this. > > result:insert(inline) > > else > > markup =3D pandoc.Inlines{pandoc.Str(first)} > > end > > else > > result:insert(inline) > > end > > else > > local last =3D inline.text:match('(.*)' .. closing .. '$') > > if last then > > markup:insert(pandoc.Str(last)) > > result:insert(markup_inlines(markup)) > > markup =3D nil > > else > > markup:insert(inline) > > end > > end > > else > > local acc =3D markup or result > > acc:insert(inline) > > end > > end > > =20 > > -- keep unterminated markup > > if markup then > > markup:remove(1) -- the stripped-down first element > > result:insert(start) > > result:extend(markup) > > end > > return result > > end > > =20 > > local function markup_inlines (inlines) return=20 > {pandoc.RawInline('tex', ' > > \\hl{')} .. inlines .. {pandoc.RawInline('tex', '}')} end > > ``` > >=20 > > **Span.lua**: > > ``` > > function Span (span) > > if span.classes:includes 'mark' then > > return {pandoc.RawInline('latex', '\\hl{')} .. > > span.content .. > > {pandoc.RawInline('latex', '}')} > > end > > end > > ``` > > This works great, I got this here: [https://gist.github.com/tarleb/ > > a0646da1834318d4f71a780edaf9f870](https://gist.github.com/tarleb/ > > a0646da1834318d4f71a780edaf9f870) > >=20 > > However, for my other usecase I'd like it to be able to render `*=3D=3D= this=20 > kind of > > highlighting=3D=3D*` as `\colorbox{lightred}{this new kind of highlight= ing}` > >=20 > > I've tried replacing the `\\hl{` with `\colorbox{declared-color}{` but= =20 > that > > didn't work. > >=20 > > I was wondering if it had something to do with the class? But renaming= =20 > that > > class from `mark` to `mark-red` didn't work either. > >=20 > > Any advice or ideas? Thanks! > >=20 > > -- > > You received this message because you are subscribed to the Google Grou= ps > > "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send= =20 > an email > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [2] > https://groups.google.com/d/msgid/ > > pandoc-discuss/79ac7814-9558-4d49-a682-cf31f970d27dn%40googlegroups.com= . > >=20 > > References: > >=20 > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [2]=20 > https://groups.google.com/d/msgid/pandoc-discuss/79ac7814-9558-4d49-a682-= cf31f970d27dn%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > --=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/bb3c6fab-dee9-48c4-81e4-7db67bc6931an%40googlegroups.com. ------=_Part_4373_1352158090.1679781670335 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I followed that, thanks! But I'm still getting `\emph{\hl{abc}` as the outp= ut, any other ideas?

Bastien DUMONT schrieb am Samstag, 25. M=C3=A4rz 202= 3 um 15:38:47 UTC+1:
First, you need to replace `\\hl{` with `\\colorbox{declared-color}= {` (mind the double backslash). Then Span.lua can be replaced with the foll= owing filter acting on emphasized (italicized) pieces of text:

in-red.lua:
```
function Emph (emph)
local content =3D emph.content
if #content =3D=3D 1
and content[1].t =3D=3D 'Span'
and content[1].classes:includes 'mark-red' then
return {
pandoc.RawInline('latex', '\\colorbox{lightred}{'= ),
content[1],
pandoc.RawInline('latex', '}')
}
end
end
```

Here, I replaced "mark" with "mark-red" as you sugg= ested because I don't remove the Span element, in case it contains othe= r classes or attributes that should be processed by other filters or by Pan= doc itself. If the Span was kept with the "mark" class, Pandoc wo= uld wrap it in the \hl macro afterwards.

Le Saturday 25 March 2023 =C3=A0 05:42:45AM, Pa Sc a =C3=A9crit :
> In markdown (written in Obsidian.md) I use a plugin/theme so that = `*=3D=3Dtext=3D=3D*`
> is rendered as red instead of italic and highlighted.
>=20
> I use this lua-filter to convert regular `=3D=3Dhighlighting=3D=3D= ` to LaTeX `\hl
> {highlighting}` which works perfectly: (I somehow require these tw= o files, I
> can't remember why)
>=20
> **highlight.lua**:
> ```
> =C2=A0 =C2=A0 --[[
> =C2=A0 =C2=A0 Add support for a custom inline syntax.
> =C2=A0 =C2=A0 This pandoc Lua filter allows to add a custom markup= syntax
> =C2=A0 =C2=A0 extension. It is designed to be adjustable; it shoul= d not be
> =C2=A0 =C2=A0 necessary to modify the code below the separator lin= e.
> =C2=A0 =C2=A0 The example here allows to add highlighted text by e= nclosing the
> =C2=A0 =C2=A0 text with `=3D=3D` on each side. Pandoc supports thi= s for HTML output
> =C2=A0 =C2=A0 out of the box. Other outputs will need additional f= ilters.
> =C2=A0 =C2=A0 Copyright: =C2=A9 2022 Albert Krewinkel
> =C2=A0 =C2=A0 License: MIT
> =C2=A0 =C2=A0 ]]
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 -- Lua pattern matching the opening markup string.
> =C2=A0 =C2=A0 local opening =3D [[=3D=3D]]
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 -- Lua pattern matching the closing markup string.
> =C2=A0 =C2=A0 local closing =3D [[=3D=3D]]
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 -- Toggle whether the opening markup may be followed= by whitespace.
> =C2=A0 =C2=A0 local nospace =3D true
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 -- Function converting the enclosed inlines to their= internal pandoc
> =C2=A0 =C2=A0 -- representation.
> =C2=A0 =C2=A0 local function markup_inlines (inlines)
> =C2=A0 =C2=A0 =C2=A0 return pandoc.Span(inlines, {class=3D"ma= rk"})
> =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 ----------------------------------------------------= --------------------
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 local function is_space (inline)
> =C2=A0 =C2=A0 =C2=A0 return inline and
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 (inline.t =3D=3D 'Space' or
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0inline.t =3D=3D 'LineBreak&#= 39; or
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0inline.t =3D=3D 'SoftBreak&#= 39;)
> =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 function Inlines (inlines)
> =C2=A0 =C2=A0 =C2=A0 local result =3D pandoc.Inlines{}
> =C2=A0 =C2=A0 =C2=A0 local markup =3D nil
> =C2=A0 =C2=A0 =C2=A0 local start =3D nil
> =C2=A0 =C2=A0 =C2=A0 for i, inline in ipairs(inlines) do
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if inline.tag =3D=3D 'Str' the= n
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not markup then
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local first =3D inline.t= ext:match('^' .. opening .. '(.*)')
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if first then
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 start =3D inline = -- keep element around in case the
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- markup is not closed. Check if the
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- closing pattern is already in this
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- string.
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local selfclosing= =3D first:match('(.*)' .. closing .. '$')
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if selfclosing th= en
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:ins= ert(markup_inlines{pandoc.Str(selfclosing)})
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 elseif nospace an= d first =3D=3D '' and is_space(inlines[i+1]) then
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -- the ope= ning pattern is followed by a space, but the
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -- config = disallows this.
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:ins= ert(inline)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup =3D= pandoc.Inlines{pandoc.Str(first)}
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:insert(inl= ine)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local last =3D inline.te= xt:match('(.*)' .. closing .. '$')
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if last then
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup:insert(pan= doc.Str(last))
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:insert(mar= kup_inlines(markup))
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup =3D nil
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup:insert(inl= ine)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local acc =3D markup or result
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 acc:insert(inline)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 =C2=A0 -- keep unterminated markup
> =C2=A0 =C2=A0 =C2=A0 if markup then
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup:remove(1) -- the stripped-down = first element
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:insert(start)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:extend(markup)
> =C2=A0 =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0 =C2=A0 return result
> =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0
> =C2=A0 =C2=A0 local function markup_inlines (inlines) =C2=A0 retur= n {pandoc.RawInline('tex', '
> \\hl{')} .. inlines .. {pandoc.RawInline('tex', '}= ')} end
> ```
>=20
> **Span.lua**:
> ```
> =C2=A0 =C2=A0 function Span (span)
> =C2=A0 =C2=A0 =C2=A0 if span.classes:includes 'mark' then
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 return {pandoc.RawInline('latex= 9;, '\\hl{')} ..
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 span.content ..
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {pandoc.RawInline('latex= 9;, '}')}
> =C2=A0 =C2=A0 =C2=A0 end
> =C2=A0 =C2=A0 end
> ```
> This works great, I got this here: [https://gist.github.com/tarleb/
> a0646da1834318d4f71a780edaf9f870](https://gist.github.com/tarleb/
> a0646da1834318d4f71a780edaf9f870)
>=20
> However, for my other usecase I'd like it to be able to render= `*=3D=3Dthis kind of
> highlighting=3D=3D*` as `\colorbox{lightred}{this new kind of high= lighting}`
>=20
> I've tried replacing the `\\hl{` with `\colorbox{declared-colo= r}{` but that
> didn't work.
>=20
> I was wondering if it had something to do with the class? But rena= ming that
> class from `mark` to `mark-red` didn't work either.
>=20
> Any advice or ideas? Thanks!
>=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 [1]pandoc-discus...@= googlegroups.com.
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/79ac7814-9558-4d49-a682-cf31f970d27dn%40googlegroups.com.
>=20
> References:
>=20
> [1] mailto:pandoc-discu= s...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups= .google.com/d/msgid/pandoc-discuss/79ac7814-9558-4d49-a682-cf31f970d27dn%40= googlegroups.com?utm_medium=3Demail&utm_source=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 pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/bb3c6fab-dee9-48c4-81e4-7db67bc6931an%40googlegroups.= com.
------=_Part_4373_1352158090.1679781670335-- ------=_Part_4372_1403772000.1679781670335--