From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32206 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ben Menashe Newsgroups: gmane.text.pandoc Subject: Re: docx -> gfm with custom styles Date: Sat, 18 Feb 2023 12:15:41 -0800 (PST) Message-ID: <085f9581-c85a-4511-ad94-ec9bca0ab8c8n@googlegroups.com> References: <3909f520-e8db-4cf9-900d-6a5a858c1a18n@googlegroups.com> <52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en@googlegroups.com> <5aeae8ad-aec8-4f00-b51c-9ffddf8c112fn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2078_1023608284.1676751341582" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37714"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDNMLY433MCBB37DYSPQMGQETUA443Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Feb 18 21:15:47 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qk1-f191.google.com ([209.85.222.191]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pTTcY-0009dd-EI for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 18 Feb 2023 21:15:46 +0100 Original-Received: by mail-qk1-f191.google.com with SMTP id bj16-20020a05620a191000b007259083a3c8sf258605qkb.7 for ; Sat, 18 Feb 2023 12:15:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1676751345; 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=G7dTYS9IlcvBY1WE7mE2gfNAjNwqPmdtJLMPmbB2Hk8=; b=KLHREUls5EezY+NgGSPWRQ470So++s/TFCKp44iP5xfss9jzFRfNPCjfAAVhfoc+kT jlDIkoloSDmkjvgg4OENZB77JYtDWB43wDdvQT/cjFvGNx5MJl8P15OKck+xRxoFsY3L d2N7JGrYKUQ8jGz3Q2h/q7Pnlbf8oUgrM/n5IJL9gFuog6HkWeJ6cjzS4wRewbRR4vMT eO/X5zdikX13ZZQFoz0DX7jT2nX/FeoPzjA4H65Hfcgf1NelcFV7EXuuMzjCL+CeMb2e vBBBe/eC7tPQ+WSq90Dynvf98WQAV2H7V6nmyuG+PT+/nCCguibv+2lBEOQx7CDTI2x2 TXww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1676751345; 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=G7dTYS9IlcvBY1WE7mE2gfNAjNwqPmdtJLMPmbB2Hk8=; b=jSmKo6BgxNMQBW6CwfKs4NDfCHocLYLLpiR6d/c5jN71dEE5TUiSSGjra/SC6dy1EC 4xFTJtHHFeIKTfx5vsZhfUvfmSgbWFZBrMcgLj8US8KfyHImv8VRVNsGKi7EhRH5XL/C htHe4buAOH1vpBCYKokBxOLUzsz1+O9sbL5RYYorknJAXgNv4CemXXHm2yHpyqlHqCv5 KkrwRaHtyUR9bdcGPUKpnsGOLkwTWB0GgLEWs7ad8GyQdid3ylL/prWQuzYoipbEZSVI 7mMtuwjZYkU8+H7rP8bnjrlCtSlGWurBHEVF1vUh33a9pTp9JQjgCJD3HtXLtHr927Ly dy+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676751345; 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=G7dTYS9IlcvBY1WE7mE2gfNAjNwqPmdtJLMPmbB2Hk8=; b=zZ1U7ZYPDOBmDIq+4TZ/DSW/Wfl2tIajF+q6Tv3hhg0cHIC8vHDh1b7ZnyMFF5omUj 4zlRlrnCRWKy+rr005Fsgp4R3+F6rBH9jXzZuOz+gsIcSfRLvViFmAuvVvOlig1zxQlu vQjHuyegbIYFf7C91mlDoTcUSJVSS2UWL+d4R5AUO3RxcQrd6Yki6nLrY/ufcb8pqG6R +W/mqokjJbBzs3LABDPU6kCR75BmwCeRQONTpzNHrcHXb/VLqlQG3kDV9zg+L5WcMHv9 6cBdUk6pQ9tF8tbOAMEbrZij/MC7T817pHkvnSnUtN/4T/t/WbFPdOrw+RffxIMDUJal Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKWQxPzzzJBeY2hFJclvZ0QlmpZbt2TsStVn/g5VLNEjc8yWamWM 1iddvdaaZdBpZXz2yuxGN08= X-Google-Smtp-Source: AK7set/oo+5dcU23asQMYlSYAfQnZ/zXGu6yQ2GRtPsSnlwEJ/1nUYL9EGi0PLrGRfU8t3OrkXz2VA== X-Received: by 2002:a0c:e4d3:0:b0:537:2321:55e2 with SMTP id g19-20020a0ce4d3000000b00537232155e2mr399810qvm.41.1676751345176; Sat, 18 Feb 2023 12:15:45 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ad4:4509:0:b0:56e:94a0:dc66 with SMTP id k9-20020ad44509000000b0056e94a0dc66ls1349809qvu.11.-pod-prod-gmail; Sat, 18 Feb 2023 12:15:42 -0800 (PST) X-Received: by 2002:a0c:f287:0:b0:56e:97de:6f59 with SMTP id k7-20020a0cf287000000b0056e97de6f59mr399108qvl.76.1676751342361; Sat, 18 Feb 2023 12:15:42 -0800 (PST) In-Reply-To: X-Original-Sender: benm5678-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:32206 Archived-At: ------=_Part_2078_1023608284.1676751341582 Content-Type: multipart/alternative; boundary="----=_Part_2079_1064594245.1676751341582" ------=_Part_2079_1064594245.1676751341582 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Oh sorry, there are few with same string, the one it fails one shows in gfm= =20 like this (w/o Lua filter): ```
> *Example666:*
``` hmm, I guess I see issue, it would not work to convert as: "## > ..." --=20 OK, perhaps header isn't the right approach for the Example style... at=20 least I have some idea now how to work with it and print out debug info.=20 Thanks for your guidance! On Saturday, February 18, 2023 at 12:59:21 PM UTC-7 Bastien DUMONT wrote: > Sorry, I don't understand why there is a block quote in native output and= =20 > not in gfm. However, has a style been applied to the "Example:" string in= =20 > the DOCX file that triggers it to be parsed as a block quote? > > Le Saturday 18 February 2023 =C3=A0 11:46:56AM, Ben Menashe a =C3=A9crit = : > > If I take out the Lua filter, I can see this is the result in md file..= .=20 > I'm > > not sure either why it's not working. > >=20 > >
> >=20 > > *Example:* > >=20 > >
> >=20 > > On Saturday, February 18, 2023 at 12:39:39 PM UTC-7 Bastien DUMONT wrot= e: > >=20 > > Inline formatting should be preserved without any problem. The cause of= =20 > the > > trouble here is is that you have a block quote inside what should be yo= ur > > header, which IMO does not make sense. > >=20 > > Le Saturday 18 February 2023 =C3=A0 11:26:01AM, Ben Menashe a =C3=A9cri= t : > > > Hmm, yea, I see -- it's part of large original docx, so it was failin= g=20 > on > > > another element styled as Example & had italics applied. > > > I printed the div in Lua filter, when it works I see this: > > > > > > ``` > > > > > > Div ("",[],[("custom-style","Example")]) [Para [Str "Test",Space,Str > > > "example"]] > > > > > > ``` > > > > > > and when fails this: > > > ``` > > > > > > Div ("",[],[("custom-style","Example")]) [BlockQuote [Para [Emph [Str > > > "Example:"]]]] > > > > > > ``` > > > > > > > > > is there any clean way to approach this so it will work in a generic= =20 > way > > and > > > preserve any other formatting applied? > > > > > > On Saturday, February 18, 2023 at 1:19:46 AM UTC-7 Bastien DUMONT=20 > wrote: > > > > > > With your examples, I get: > > > > > > ## Scope > > > > > >
> > > > > > Test body > > > > > >
> > > > > > ## Test nested > > > > > > Le Friday 17 February 2023 =C3=A0 07:00:47AM, Ben Menashe a =C3=A9cri= t : > > > > Thank you so much...that worked - I was missing the [1].content. > > > > But let's say I have another 'Example' custom style under it... w/o= =20 > Lua > > > filter > > > > it renders this structure: > > > > > > > > ``` > > > >
> > > > > > > > Scope > > > > > > > >
> > > > > > > >
> > > > > > > > Test body > > > > > > > >
> > > > > > > >
> > > > > > > > Test nested > > > > > > > >
> > > > ``` > > > > > > > > And with filter below it fails on line 8 w/ this error "Inline, lis= t=20 > of > > > > Inlines, or string expected, got Blocks"... any idea on how to > > > troubleshoot > > > > such issues?: > > > > > > > > ``` > > > > return { > > > > { > > > > Div =3D function (div) > > > > if (div.attributes['custom-style'] =3D=3D 'Internal Heading') then > > > > return pandoc.Header(2, div.content[1].content) > > > > end > > > > if (div.attributes['custom-style'] =3D=3D 'Example') then > > > > return pandoc.Header(2, div.content[1].content) > > > > end > > > > > > > > return div > > > > end, > > > > } > > > > } > > > > ``` > > > > On Friday, February 17, 2023 at 1:10:11 AM UTC-7 Bastien DUMONT=20 > wrote: > > > > > > > > In this case, it would be preferable to turn the div into a Header > > > element > > > > and let Pandoc format it itself: > > > > > > > > ``` > > > > function Div(div) > > > > if div.attributes['custom-style'] =3D=3D 'Internal Heading' then > > > > return pandoc.Header(2, div.content[1].content) > > > > end > > > > end > > > > ``` > > > > > > > > Le Thursday 16 February 2023 =C3=A0 08:00:08PM, Ben Menashe a =C3= =A9crit : > > > > > Hi, > > > > > We have a need to convert docx to gfm. > > > > > Since docx has some user defined styles we use this "+styles" > > > extension: > > > > > > > > > > > > > > > pandoc --to=3Dgfm -f docx+styles --output=3Drtb.md --extract-medi= a=3D. > > --wrap > > > =3D > > > > none > > > > > 'rtb.docx' > > > > > > > > > > > > > > > So now we have html div that wraps our content. Let's say I want= =20 > to > > > > transform > > > > > this: > > > > > > > > > >
> > > > > > > > > > Scope > > > > > > > > > >
> > > > > > > > > > Into: > > > > > > > > > > ## Scope > > > > > > > > > > How can it be done? I tried to setup a Lua filter but not having > > > success > > > > to > > > > > have it output "##" along with the div content. > > > > > > > > > > > > > > > -- > > > > > You received this message because you are subscribed to the Googl= e > > > Groups > > > > > "pandoc-discuss" group. > > > > > To unsubscribe from this group and stop receiving emails from it, > > send > > > an > > > > email > > > > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > > > To view this discussion on the web visit [2][1][1]https:// > > > [1]groups.google.com/ > > > > d/msgid/ > > > > > pandoc-discuss/3909f520-e8db-4cf9-900d-6a5a858c1a18n%[2] > > > > [2][2]40googlegroups.com. > > > > > > > > > > References: > > > > > > > > > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > > > > [2] [3][3][3]https://groups.google.com/d/msgid/pandoc-discuss/ > > > > 3909f520-e8db-4cf9-900d-6a5a858c1a18n%[4][4]40googlegroups.com? > > utm_medium=3D > > > email& > > > > utm_source=3Dfooter > > > > > > > > > > > > -- > > > > 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,= =20 > send > > an > > > email > > > > to [4]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > > To view this discussion on the web visit [5][5][5]https:// > > groups.google.com/ > > > d/msgid/ > > > > pandoc-discuss/52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en%[6] > > > [6]40googlegroups.com. > > > > > > > > References: > > > > > > > > [1] [7][7]https://groups.google.com/d/msgid/ > > > > [2] [8][8]http://40googlegroups.com/ > > > > [3] [9][9]https://groups.google.com/d/msgid/pandoc-discuss/ > > > 3909f520-e8db-4cf9-900d-6a5a858c1a18n%[10] > 40googlegroups.com?utm_medium=3D > > email& > > > utm_source=3Dfooter > > > > [4] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > > > [5] [10][11]https://groups.google.com/d/msgid/pandoc-discuss/ > > > 52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en%[12] > 40googlegroups.com?utm_medium=3D > > email& > > > utm_source=3Dfooter > > > > > > > > > -- > > > You received this message because you are subscribed to the Google=20 > Groups > > > "pandoc-discuss" group. > > > To unsubscribe from this group and stop receiving emails from it, sen= d=20 > an > > email > > > to [11]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To view this discussion on the web visit [12][13]https:// > > groups.google.com/d/msgid/ > > > pandoc-discuss/ef5a0088-1df4-4540-98d5-a0120df8f3cen%[14] > > 40googlegroups.com. > > > > > > References: > > > > > > [1] [15]https://groups.google.com/ > > > [2] [16]http://40googlegroups.com/ > > > [3] [17]https://groups.google.com/d/msgid/pandoc-discuss/ > > > [4] [18]http://40googlegroups.com/?utm_medium=3Demail& > > > [5] [19]https://groups.google.com/d/msgid/ > > > [6] [20]http://40googlegroups.com/ > > > [7] [21]https://groups.google.com/d/msgid/ > > > [8] [22]http://40googlegroups.com/ > > > [9] [23]https://groups.google.com/d/msgid/pandoc-discuss/ > > 3909f520-e8db-4cf9-900d-6a5a858c1a18n% > 40googlegroups.com?utm_medium=3Demail& > > utm_source=3Dfooter > > > [10] [24]https://groups.google.com/d/msgid/pandoc-discuss/ > > 52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en% > 40googlegroups.com?utm_medium=3Demail& > > utm_source=3Dfooter > > > [11] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > > [12] [25]https://groups.google.com/d/msgid/pandoc-discuss/ > > ef5a0088-1df4-4540-98d5-a0120df8f3cen% > 40googlegroups.com?utm_medium=3Demail& > > utm_source=3Dfooter > >=20 > >=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 [26]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [27] > https://groups.google.com/d/msgid/ > > pandoc-discuss/5aeae8ad-aec8-4f00-b51c-9ffddf8c112fn%40googlegroups.com= . > >=20 > > References: > >=20 > > [1] http://groups.google.com/ > > [2] http://40googlegroups.com/ > > [3] https://groups.google.com/d/msgid/pandoc-discuss/ > > [4] http://40googlegroups.com/?utm_medium=3D > > [5] https://groups.google.com/ > > [6] http://40googlegroups.com/ > > [7] https://groups.google.com/d/msgid/ > > [8] http://40googlegroups.com/ > > [9] https://groups.google.com/d/msgid/pandoc-discuss/ > > [10] http://40googlegroups.com/?utm_medium=3Demail& > > [11] https://groups.google.com/d/msgid/pandoc-discuss/ > > [12] http://40googlegroups.com/?utm_medium=3Demail& > > [13] https://groups.google.com/d/msgid/ > > [14] http://40googlegroups.com/ > > [15] https://groups.google.com/ > > [16] http://40googlegroups.com/ > > [17] https://groups.google.com/d/msgid/pandoc-discuss/ > > [18] http://40googlegroups.com/?utm_medium=3Demail& > > [19] https://groups.google.com/d/msgid/ > > [20] http://40googlegroups.com/ > > [21] https://groups.google.com/d/msgid/ > > [22] http://40googlegroups.com/ > > [23]=20 > https://groups.google.com/d/msgid/pandoc-discuss/3909f520-e8db-4cf9-900d-= 6a5a858c1a18n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > [24]=20 > https://groups.google.com/d/msgid/pandoc-discuss/52ada5c3-e26e-4c8c-8b3f-= b55bb8ce8e1en%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > [25]=20 > https://groups.google.com/d/msgid/pandoc-discuss/ef5a0088-1df4-4540-98d5-= a0120df8f3cen%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > [26] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [27]=20 > https://groups.google.com/d/msgid/pandoc-discuss/5aeae8ad-aec8-4f00-b51c-= 9ffddf8c112fn%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/085f9581-c85a-4511-ad94-ec9bca0ab8c8n%40googlegroups.com. ------=_Part_2079_1064594245.1676751341582 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Oh sorry, there are few with same string, the one it fails one shows in gfm= like this (w/o Lua filter):

```
&= lt;div custom-style=3D"Example">

> *Example666:*

</div>
```

hmm, I guess I see issue, it would= not work to convert as: "## > ..." -- OK, perhaps header isn't the righ= t approach for the Example style... at least I have some idea now how to wo= rk with it and print out debug info. =C2=A0Thanks for your guidance!
<= div>
On Saturday, February 18, 2023 at 12:59:21 PM UTC-7 Bastien DUMONT w= rote:
Sorry, = I don't understand why there is a block quote in native output and not = in gfm. However, has a style been applied to the "Example:" strin= g in the DOCX file that triggers it to be parsed as a block quote?

Le Saturday 18 February 2023 =C3=A0 11:46:56AM, Ben Menashe a =C3=A9cri= t :
> If I take out the Lua filter, I can see this is the result in md f= ile... I'm
> not sure either why it's not working.
>=20
> <div custom-style=3D"Example">
>=20
> *Example:*
>=20
> </div>
>=20
> On Saturday, February 18, 2023 at 12:39:39 PM UTC-7 Bastien DUMONT= wrote:
>=20
> Inline formatting should be preserved without any problem. The= cause of the
> trouble here is is that you have a block quote inside what sho= uld be your
> header, which IMO does not make sense.
>=20
> Le Saturday 18 February 2023 =C3=A0 11:26:01AM, Ben Menashe a = =C3=A9crit :
> > Hmm, yea, I see -- it's part of large original docx, = so it was failing on
> > another element styled as Example & had italics appli= ed.
> > I printed the div in Lua filter, when it works I see this= :
> >
> > ```
> >
> > Div ("",[],[("custom-style","Exa= mple")]) [Para [Str "Test",Space,Str
> > "example"]]
> >
> > ```
> >
> > and when fails this:
> > ```
> >
> > Div ("",[],[("custom-style","Exa= mple")]) [BlockQuote [Para [Emph [Str
> > "Example:"]]]]
> >
> > ```
> >
> >
> > is there any clean way to approach this so it will work i= n a generic way
> and
> > preserve any other formatting applied?
> >
> > On Saturday, February 18, 2023 at 1:19:46 AM UTC-7 Bastie= n DUMONT wrote:
> >
> > With your examples, I get:
> >
> > ## Scope
> >
> > <div custom-style=3D"Body Text">
> >
> > Test body
> >
> > </div>
> >
> > ## Test nested
> >
> > Le Friday 17 February 2023 =C3=A0 07:00:47AM, Ben Menashe= a =C3=A9crit :
> > > Thank you so much...that worked - I was missing the = [1].content.
> > > But let's say I have another 'Example' c= ustom style under it... w/o Lua
> > filter
> > > it renders this structure:
> > >
> > > ```
> > > <div custom-style=3D"Internal Heading"&= gt;
> > >
> > > Scope
> > >
> > > </div>
> > >
> > > <div custom-style=3D"Body Text">
> > >
> > > Test body
> > >
> > > </div>
> > >
> > > <div custom-style=3D"Example">
> > >
> > > Test nested
> > >
> > > </div>
> > > ```
> > >
> > > And with filter below it fails on line 8 w/ this err= or "Inline, list of
> > > Inlines, or string expected, got Blocks"... any= idea on how to
> > troubleshoot
> > > such issues?:
> > >
> > > ```
> > > return {
> > > {
> > > Div =3D function (div)
> > > if (div.attributes['custom-style'] =3D=3D &#= 39;Internal Heading') then
> > > return pandoc.Header(2, div.content[1].content)
> > > end
> > > if (div.attributes['custom-style'] =3D=3D &#= 39;Example') then
> > > return pandoc.Header(2, div.content[1].content)
> > > end
> > >
> > > return div
> > > end,
> > > }
> > > }
> > > ```
> > > On Friday, February 17, 2023 at 1:10:11 AM UTC-7 Bas= tien DUMONT wrote:
> > >
> > > In this case, it would be preferable to turn the div= into a Header
> > element
> > > and let Pandoc format it itself:
> > >
> > > ```
> > > function Div(div)
> > > if div.attributes['custom-style'] =3D=3D = 9;Internal Heading' then
> > > return pandoc.Header(2, div.content[1].content)
> > > end
> > > end
> > > ```
> > >
> > > Le Thursday 16 February 2023 =C3=A0 08:00:08PM, Ben = Menashe a =C3=A9crit :
> > > > Hi,
> > > > We have a need to convert docx to gfm.
> > > > Since docx has some user defined styles we use = this "+styles"
> > extension:
> > > >
> > > >
> > > > pandoc --to=3Dgfm -f docx+styles --output=3Drtb= .md --extract-media=3D.
> --wrap
> > =3D
> > > none
> > > > 'rtb.docx'
> > > >
> > > >
> > > > So now we have html div that wraps our content.= =C2=A0Let's say I want to
> > > transform
> > > > this:
> > > >
> > > > <div custom-style=3D"Internal Heading&q= uot;>
> > > >
> > > > Scope
> > > >
> > > > </div>
> > > >
> > > > Into:
> > > >
> > > > ## Scope
> > > >
> > > > How can it be done? I tried to setup a Lua filt= er but not having
> > success
> > > to
> > > > have it output "##" along with the di= v content.
> > > >
> > > >
> > > > --
> > > > You received this message because you are subsc= ribed to the Google
> > Groups
> > > > "pandoc-discuss" group.
> > > > To unsubscribe from this group and stop receivi= ng emails from it,
> send
> > an
> > > email
> > > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> > > > To view this discussion on the web visit [2][1]= [1]https://
> > [1]groups.google.com/
> > > d/msgid/
> > > > pandoc-discuss/3909f520-e8db-4cf9-900d-6a5a858c= 1a18n%[2]
> > > [2][2]40googlegroups.= com.
> > > >
> > > > References:
> > > >
> > > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > > [2] [3][3][3]https://groups.google.com/d/msgid/= pandoc-discuss/
> > > 3909f520-e8db-4cf9-900d-6a5a858c1a18n%[4][4]40googlegroups.com?
> utm_medium=3D
> > email&
> > > utm_source=3Dfooter
> > >
> > >
> > > --
> > > You received this message because you are subscribed= to the Google
> Groups
> > > "pandoc-discuss" group.
> > > To unsubscribe from this group and stop receiving em= ails from it, send
> an
> > email
> > > to [4]pan= doc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> > > To view this discussion on the web visit [5][5][5]ht= tps://
> groups.google.com/
> > d/msgid/
> > > pandoc-discuss/52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en= %[6]
> > [6]40googlegroups.com.
> > >
> > > References:
> > >
> > > [1] [7][7]https://groups.google.com/d/msgid/
> > > [2] [8][8]http://40goog= legroups.com/
> > > [3] [9][9]https://groups.google.com/d/msgid/pandoc-d= iscuss/
> > 3909f520-e8db-4cf9-900d-6a5a858c1a18n%[10]40googlegroups.com?utm_medium=3D
> email&
> > utm_source=3Dfooter
> > > [4] mailto:
pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [5] [10][11]https://groups.google.com/d/msgid/pandoc= -discuss/
> > 52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en%[12]40googlegroups.com?utm_medium=3D
> email&
> > utm_source=3Dfooter
> >
> >
> > --
> > You received this message because you are subscribed to t= he Google Groups
> > "pandoc-discuss" group.
> > To unsubscribe from this group and stop receiving emails = from it, send an
> email
> > to [11]
pandoc-= discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> > To view this discussion on the web visit [12][13]https://
> groups.google.com/d= /msgid/
> > pandoc-discuss/ef5a0088-1df4-4540-98d5-a0120df8f3cen%[14]
> 40googlegroups.com.
> >
> > References:
> >
> > [1] [15]https://groups.googl= e.com/
> > [2] [16]http://40googlegroup= s.com/
> > [3] [17]https://groups.google.com/d/msgid/pandoc-discuss/=
> > [4] [18]http://40googlegroups.com/?utm_medium=3Demail&am= p;
> > [5] [19]http= s://groups.google.com/d/msgid/
> > [6] [20]http://40googlegroup= s.com/
> > [7] [21]http= s://groups.google.com/d/msgid/
> > [8] [22]http://40googlegroup= s.com/
> > [9] [23]https://groups.google.com/d/msgid/pandoc-discuss/=
> 3909f520-e8db-4cf9-900d-6a5a858c1a18n%40googlegroups.com?utm_med= ium=3Demail&
> utm_source=3Dfooter
> > [10] [24]https://groups.google.com/d/msgid/pandoc-discuss= /
> 52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en%40googlegroups.com?utm_med= ium=3Demail&
> utm_source=3Dfooter
> > [11] mailto:pa= ndoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [12] [25]https://groups.google.com/d/msgid/pandoc-discuss= /
> ef5a0088-1df4-4540-98d5-a0120df8f3cen%40googlegroups.com?utm_med= ium=3Demail&
> utm_source=3Dfooter
>=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 email
> to [26]pandoc-discus...= @googlegroups.com.
> To view this discussion on the web visit [27]https://groups.google.com/d/msgid/
> pandoc-discuss/5aeae8ad-aec8-4f00-b51c-9ffddf8c112fn%40googlegroups.com.
>=20
> References:
>=20
> [1] http://groups.google.com/
> [2] http://40googlegroups.com/
> [3] https://groups.google.com/d/msgid/pandoc-discuss/
> [4] http:= //40googlegroups.com/?utm_medium=3D
> [5] https://groups.google.com/
> [6] http://40googlegroups.com/
> [7] https://groups.= google.com/d/msgid/
> [8] http://40googlegroups.com/
> [9] https://groups.google.com/d/msgid/pandoc-discuss/
> [10] http://40googlegroups.com/?utm_medium=3Demail&
> [11] https://groups.google.com/d/msgid/pandoc-discuss/
> [12] http://40googlegroups.com/?utm_medium=3Demail&
> [13] https://groups.= google.com/d/msgid/
> [14] http://40googlegroups.com/
> [15] https://groups.google.com/
> [16] http://40googlegroups.com/
> [17] https://groups.google.com/d/msgid/pandoc-discuss/
> [18] http://40googlegroups.com/?utm_medium=3Demail&
> [19] https://groups.= google.com/d/msgid/
> [20] http://40googlegroups.com/
> [21] https://groups.= google.com/d/msgid/
> [22] http://40googlegroups.com/
> [23] https://group= s.google.com/d/msgid/pandoc-discuss/3909f520-e8db-4cf9-900d-6a5a858c1a18n%4= 0googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
> [24] https://group= s.google.com/d/msgid/pandoc-discuss/52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en%4= 0googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
> [25] https://group= s.google.com/d/msgid/pandoc-discuss/ef5a0088-1df4-4540-98d5-a0120df8f3cen%4= 0googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
> [26] mailto:pandoc-disc= us...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [27] https://group= s.google.com/d/msgid/pandoc-discuss/5aeae8ad-aec8-4f00-b51c-9ffddf8c112fn%4= 0googlegroups.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/085f9581-c85a-4511-ad94-ec9bca0ab8c8n%40googlegroups.= com.
------=_Part_2079_1064594245.1676751341582-- ------=_Part_2078_1023608284.1676751341582--