From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32893 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sigismond Newsgroups: gmane.text.pandoc Subject: Re: docx+styles to dokuwiki somehow ? Date: Thu, 29 Jun 2023 06:11:07 -0700 (PDT) Message-ID: <48c40b5c-7f08-4c57-b7dd-45ae7accce9dn@googlegroups.com> References: <16df0de5-a608-4e6e-9545-3fa338229d8fn@googlegroups.com> <62b0db64-b7ab-48e8-9025-9c969304e1b6n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_14236_58494219.1688044267167" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26127"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCJ4VS5M3INRB3EF62SAMGQEYDDMREY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 29 15:11:13 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f59.google.com ([209.85.210.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qErQW-0006Zd-AH for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 29 Jun 2023 15:11:12 +0200 Original-Received: by mail-ot1-f59.google.com with SMTP id 46e09a7af769-6b86bff7180sf859668a34.1 for ; Thu, 29 Jun 2023 06:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1688044271; x=1690636271; 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=8nsiqVFH+8h4ME2gekWNvuU8O4mRcKsI7lF5uHuPN70=; b=sc5peAHbw7j8wfo6TOE2e7bxSP/6FD8K8ho9eAlzbgogakZCClR+BATvZYUSTALDkB EBeMpvu/S69pHmGfk4FMFahnY2moUCqHe+sBwm5LEEahPzCRJOqp5PB/086S0LxB67iY alO9U3oAjj8pD7YWZy5VFmynFp79najyEvt9oRjq/GLohvx5JDShezN3dGuSkoqXutTx l5h58/QXO/wY3Oz2Xtp+r20mgqvu9xrX6yWszLKcARjyW9PeurMgE5S1pctAYmU5x8j6 O6AN46U5cDG1E7opQRxVaLr4SlLLDwkjikeM0zc6ytvJwV4vLUOzaLAgYXrPkJKa2sFn +u3w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688044271; x=1690636271; 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=8nsiqVFH+8h4ME2gekWNvuU8O4mRcKsI7lF5uHuPN70=; b=UbbaVBDVxDUYQXo+Wjocnd7PG8osRcw+qxZlp3oAB4qZ4pUhYMdov3mdSW6c8v3uVM elg6zgfGVqJyvu+DacBaS1uJk7/9efqqW6HsWC6ZbzP2HPlRyDt/FYSDsJ152CWZeKvx vlK3gPDKP5hp1QZSaV/GARBBjIaPNOwc0ImAoVEfISb8/WArgSjAt1J9tpmBvCTTWlVz 4OQMtloU9u0YR0QtrE5K3xABu+2x2+VBOwgJo43xVTNBxbAsW8rKOt2v16p8lWFDPIcL y1L9U8uZB8wIh8qiQ0N2nNFOO5v3uy7TkRmQMyAj4bp6NZjJXlACEli+5Pt4iT2jl1GG tQtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688044271; x=1690636271; 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-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=8nsiqVFH+8h4ME2gekWNvuU8O4mRcKsI7lF5uHuPN70=; b=RVI6eC/ngeqM5Axr+1aV0NUj/0OvQDMgM98yuIFs4h+BbqJyGmOtq8XGeGSset2uJl khnQN+GuqWycauKM6T4GspX20XxqDV4pTdaX2nGzEEICm6dBVEoBo6CAEN3erMjACTaD xuFDWgy0HxjXC8yYB6noV5rCFmYlwX4U3oD9PX4ZoTiITFMYUI9kxrN1Xh24EaI718HA 24+Tmi1iEHIr+Fe3hFQ5aibAWn3o/aaxaSfOO/yTlRMz/acm8H3o5fxeAE4EouyHGR5+ QiSwz1QS+qXwYlbSBC4ztO6EhhJA6axrs6Lx6YdwrCaeyt10sU Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDyLraH5Ye1KeZV5kN+aqfrMEunlab/7aTEsWhhqneL4XgkxMc9M e1w8stj9DpCgdV6tWePUE2o= X-Google-Smtp-Source: ACHHUZ7wK7839kVr4wtBfGsuIkpbSQ1MEDLmNlf6KBuSatuCw4wKdDW8z2jKCfquLPt/uz29vGSu5A== X-Received: by 2002:a05:6830:1e46:b0:6b7:2e71:1198 with SMTP id e6-20020a0568301e4600b006b72e711198mr12764301otj.27.1688044271113; Thu, 29 Jun 2023 06:11:11 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6871:d12:b0:1b0:67ac:3bbb with SMTP id vh18-20020a0568710d1200b001b067ac3bbbls948654oab.0.-pod-prod-05-us; Thu, 29 Jun 2023 06:11:08 -0700 (PDT) X-Received: by 2002:a05:6870:7c10:b0:1b0:460c:548b with SMTP id je16-20020a0568707c1000b001b0460c548bmr7015180oab.3.1688044267821; Thu, 29 Jun 2023 06:11:07 -0700 (PDT) In-Reply-To: X-Original-Sender: pascal.conil.lacoste-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:32893 Archived-At: ------=_Part_14236_58494219.1688044267167 Content-Type: multipart/alternative; boundary="----=_Part_14237_2077473316.1688044267167" ------=_Part_14237_2077473316.1688044267167 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you Bastien, I tried many variations and eventually=E2=80=A6 This one worked ! ``` function Div (div) local custom_style =3D div.attributes['custom-style'] if custom_style then if (custom_style =3D=3D 'mots') or (custom_style =3D=3D 'motspremier') then return pandoc.Header(1,div.content[1].content) else local pre =3D pandoc.RawBlock('dokuwiki', '') local post =3D pandoc.RawBlock('dokuwiki', '') local content =3D div.content table.insert(content, 1, pre) table.insert(content, post) return content end end end ``` Le mercredi 28 juin 2023 =C3=A0 18:52:39 UTC+2, Bastien DUMONT a =C3=A9crit= : > Your last filter dos not return one block, but three (a RawBlock is a=20 > Block!). If you want to convert the div to a header, just return a Header= =20 > object (see the document to know how to use the constructor pandoc.Header= ). > > Le Wednesday 28 June 2023 =C3=A0 08:00:05AM, Sigismond a =C3=A9crit : > > @Bastien > > I managed to extend your workaround to the other badly handled types,= =20 > thank > > you. > > Then, I tried to extend this already very useful lua filter in order to= =20 > convert > > some specific custom-styled divs to level 1 titles in dokuwiki output. > >=20 > > For example, with `Warburg (Otto Heinrich)` having the custom-style=20 > `mots`, > > what I get is > > ``` > > > > Warburg (Otto Heinrich) > >=20 > > > > ``` > > what I would like is > > ``` > > =3D=3D=3D=3D=3D=3D Warburg (Otto Heinrich) =3D=3D=3D=3D=3D=3D > > ``` > >=20 > > So I modified the filter to add a new condition :=20 > > ``` > > function Div (div) > > local custom_style =3D div.attributes['custom-style'] > > if custom_style then > > if custom_style =3D=3D 'mots' then > > local pre =3D pandoc.RawBlock('dokuwiki', '=3D=3D=3D=3D=3D=3D') > > local post =3D pandoc.RawBlock('dokuwiki', '=3D=3D=3D=3D=3D=3D') > > else > > local pre =3D pandoc.RawBlock('dokuwiki', '') > > local post =3D pandoc.RawBlock('dokuwiki', '') > > end > > local content =3D div.content > > table.insert(content, 1, pre) > > table.insert(content, post) > > return content > > end > > end > > ``` > >=20 > > Well, it doesn't work in many ways : > > - first, it tells me that=20 > > Block, list of Blocks, or compatible element expected, got Blocks > > I guess my condition is badly formed. > >=20 > > - then if I just try to test it without the added (and buggy) condition= , > > ``` > > function Div (div) > > local custom_style =3D div.attributes['custom-style'] > > if custom_style then > > local pre =3D pandoc.RawBlock('dokuwiki', '=3D=3D=3D=3D=3D=3D') > > local post =3D pandoc.RawBlock('dokuwiki', '=3D=3D=3D=3D=3D=3D') > > local content =3D div.content > > table.insert(content, 1, pre) > > table.insert(content, post) > > return content > > end > > end > > ``` > > I get=E2=80=A6 a block > > ``` > > =3D=3D=3D=3D=3D=3D > > Warburg (Otto Heinrich) > >=20 > > =3D=3D=3D=3D=3D=3D > > ``` > > which doesn't convert to a proper level 1 title in dokuwiki. > >=20 > > I understand that my desired modification is inline whereas the origina= l=20 > filter > > is designed to manage blocks but my lack of knowledge in lua lets me=20 > struggling > > to go past that. > >=20 > > Could you please show me the way to do this ? > > Thanks. > >=20 > > Le mardi 27 juin 2023 =C3=A0 12:21:20 UTC+2, Sigismond a =C3=A9crit : > >=20 > > Thank you Bastien. > > I did not find a bug report that specifically treats this issue. Many= =20 > other > > issues with dokuwiki and lists though. > > So that's [1]a bug report #8920 > >=20 > > Le mardi 27 juin 2023 =C3=A0 11:53:48 UTC+2, Bastien DUMONT a =C3=A9cri= t : > >=20 > > I think that it is worth a bug report if it has not been done yet. As a > > workaround, you can expand the filter to remove all divs with > > custom-style from the bullet lists. > >=20 > > ``` > > function Div (div) > > local custom_style =3D div.attributes['custom-style'] > > if custom_style then > > local pre =3D pandoc.RawBlock('dokuwiki', ' > '">') > > local post =3D pandoc.RawBlock('dokuwiki', '') > > table.insert(div.content, post) > > table.insert(div.content, 1, pre) > > return div.content > > end > > end > >=20 > > local remove_custom_styles =3D { > > Div =3D function(div) > > if div.attributes['custom-style'] then > > return div.content > > end > > end > > } > >=20 > > function BulletList(list) > > -- Do the same for all types that are badly handled with docx+styles > > -- (e.g. OrderedList) > > return list:walk(remove_custom_styles) > > end > >=20 > > return { > > -- We must process the bullet lists first to remove the divs > > -- before they are converted to raw code. > > { BulletList =3D BulletList }, > > { Div =3D Div } > > } > >=20 > > ``` > >=20 > > Le Tuesday 27 June 2023 =C3=A0 02:35:06AM, Sigismond a =C3=A9crit : > > > Well=E2=80=A6 it does work but, somehow, docx+styles messes with the = lists : > > > For a simple docx with just one list, unordered here is what I get > > with -f > > > docx+styles -t dokuwiki : > > >
    > > >
  • Liste 1

    > > >
  • > > >
  • liste 2

    > > >
  • > > >
  • liste 3

    > > > > > >
      > > >
    • liste 3a

      > > >
    • > > >
    • liste 3b

      > > >
    • > > >
    • liste 3c

      > > >
    > > >
  • > > >
  • liste 4

    > > >
> > > > > > Which is not parsed by dokuwiki. > > > > > > > > > Without +styles : > > > * Liste 1 > > > * liste 2 > > > * liste 3 > > > * liste 3a > > > * liste 3b > > > * liste 3c > > > * liste 4 > > > > > > Which is syntactically correct dokuwiki format. > > > > > > If I understand it well, Pandoc seems to consider an ordered list > > badly > > > formatted only when +styles is applied and it spits out some raw html > > with

> > > tags inside

  • s > > > > > > So what is it ? Bad implementation in Dokuwiki writer ?=20 > > > How can I benefit from both +styles, with my lua filter, and lists ?= =20 > > > > > > -- > > > Pascal > > > Le lundi 26 juin 2023 =C3=A0 16:04:17 UTC+2, Sigismond a =C3=A9crit : > > > > > > Thanks a lot Bastien, it works perfectly well. > > > > > > Le lundi 26 juin 2023 =C3=A0 15:47:00 UTC+2, Bastien DUMONT a =C3=A9c= rit : > > > > > > With `-f docx+styles`, you can replace the divs with custom styles > > with > > > this kind of filter: > > > > > > ``` > > > function Div (div) > > > local custom_style =3D div.attributes['custom-style'] > > > if custom_style then > > > local pre =3D pandoc.RawBlock('dokuwiki', ' > > '">') > > > local post =3D pandoc.RawBlock('dokuwiki', '') > > > local content =3D div.content > > > table.insert(content, 1, pre) > > > table.insert(content, post) > > > return content > > > end > > > end > > > ``` > > > > > > Le Monday 26 June 2023 =C3=A0 06:16:48AM, Sigismond a =C3=A9crit : > > > > OK, let's try it another way : > > > > > > > > I plan to use Pandoc to convert several docx files to dokuwiki > > > format. > > > > I need to retain custom block styles and convert them to custom > > tags, > > > something > > > > like=20 > > > > > > > > > > > > my dokuwiki formatted block text > > > > > > > > > > > > Do I need to develop a custom dokuwiki writer from scratch to do > > that > > > or is > > > > there a way to use lua filters for this purpose. > > > > Sorry if the answer is obvious but I struggle to find relevant > > > information. > > > > > > > > Thanks for any help, > > > > -- > > > > Pascal > > > > > > > > > > > > Le mercredi 26 avril 2023 =C3=A0 16:14:20 UTC+2, pascal Conil-lacos= te a > > > =C3=A9crit : > > > > > > > > Hi everybody, > > > > > > > > I've been using pandoc for some years to accomplish very > > > straightforward > > > > conversions. > > > > Now that what I plan to do is a little more complex, I struggle to > > > find > > > > relevant information. > > > > > > > > I need to convert docx to dokuwiki and retain Word custom styles. I > > > thought > > > > I could use docx+styles to get custom-styles in dokuwiki files but > > > they > > > > don't make it to the output and get stripped. > > > > > > > > I would be happy with ::: {custom-style=3D"myStyle"} my text here::= : > > > > > > > > If I could get something along these lines, I would be able to > > apply > > > some > > > > other simple transformation to get to the final dokuwiki files and > > > treat > > > > them with a plugin. > > > > > > > > What is the best way to achieve this ? Filters ? Templates ? > > > > > > > > Any help welcome! > > > > > > > > -- > > > > 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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > > To view this discussion on the web visit [2][1]https:// > > > [2]groups.google.com/d/msgid/ > > > > pandoc-discuss/bdc377c4-3918-4f0f-a87e-a66f9d128cc2n%[2] > > > [3]40googlegroups.com. > > > > > > > > References: > > > > > > > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > > > [2] [3][4]https://groups.google.com/d/msgid/pandoc-discuss/ > > > bdc377c4-3918-4f0f-a87e-a66f9d128cc2n%[5]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, > > send an email > > > to [4]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To view this discussion on the web visit [5][6]https:// > > groups.google.com/d/msgid/ > > > pandoc-discuss/f0b95670-24a3-4870-842f-fb6e7791a694n%[7] > > 40googlegroups.com. > > > > > > References: > > > > > > [1] [8]https://groups.google.com/d/msgid/ > > > [2] [9]http://40googlegroups.com/ > > > [3] [10]https://groups.google.com/d/msgid/pandoc-discuss/ > > bdc377c4-3918-4f0f-a87e-a66f9d128cc2n%40googlegroups.com?utm_medium=3D > > email&utm_source=3Dfooter > > > [4] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > > [5] [11]https://groups.google.com/d/msgid/pandoc-discuss/ > > f0b95670-24a3-4870-842f-fb6e7791a694n%40googlegroups.com?utm_medium=3D > > email&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 [12]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [13] > https://groups.google.com/d/msgid/ > > pandoc-discuss/62b0db64-b7ab-48e8-9025-9c969304e1b6n%40googlegroups.com= . > >=20 > > References: > >=20 > > [1] https://github.com/jgm/pandoc/issues/8920 > > [2] http://groups.google.com/d/msgid/ > > [3] http://40googlegroups.com/ > > [4] https://groups.google.com/d/msgid/pandoc-discuss/ > > [5] http://40googlegroups.com/?utm_medium=3D > > [6] https://groups.google.com/d/msgid/ > > [7] http://40googlegroups.com/ > > [8] https://groups.google.com/d/msgid/ > > [9] http://40googlegroups.com/ > > [10]=20 > https://groups.google.com/d/msgid/pandoc-discuss/bdc377c4-3918-4f0f-a87e-= a66f9d128cc2n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > [11]=20 > https://groups.google.com/d/msgid/pandoc-discuss/f0b95670-24a3-4870-842f-= fb6e7791a694n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > [12] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [13]=20 > https://groups.google.com/d/msgid/pandoc-discuss/62b0db64-b7ab-48e8-9025-= 9c969304e1b6n%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/48c40b5c-7f08-4c57-b7dd-45ae7accce9dn%40googlegroups.com. ------=_Part_14237_2077473316.1688044267167 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you Bastien, I tried many variations and eventually=E2=80=A6
    This= one worked !
    ```
    function Div (div)
    local custom_style =3D div.attributes['custo= m-style']
    if custom_style th= en
    if (custom_style =3D=3D = 'mots') or (custom_style =3D=3D 'motspremier') then
    =C2=A0 re= turn pandoc.Header(1,div.content[1].content)
    else
    loc= al pre =3D pandoc.RawBlock('dokuwiki', '<WRAP ' .. custom_style .. '>= ')
    local post =3D pandoc.R= awBlock('dokuwiki', '</WRAP>')
    local content =3D div.content
    table.insert(content, 1, pre)
    table.insert(content, post)
    return content
    = end
    end
    end```
    Le mercredi 28 juin 2023 =C3=A0 18:52:39 UTC+2, Bastien DUMONT a = =C3=A9crit=C2=A0:
    Your last filter dos not return one block, but three (a RawBlock is a = Block!). If you want to convert the div to a header, just return a Header o= bject (see the document to know how to use the constructor pandoc.Header).

    Le Wednesday 28 June 2023 =C3=A0 08:00:05AM, Sigismond a =C3=A9crit :
    > @Bastien
    > I managed to extend your workaround to the other badly handled typ= es, thank
    > you.
    > Then, I tried to extend this already very useful lua filter in ord= er to convert
    > some specific custom-styled divs to level 1 titles in dokuwiki out= put.
    >=20
    > For example, with `Warburg (Otto Heinrich)` having the custom-styl= e `mots`,
    > what I get is
    > ```
    > <WRAP mots>
    > Warburg (Otto Heinrich)
    >=20
    > </WRAP>
    > ```
    > what I would like is
    > ```
    > =3D=3D=3D=3D=3D=3D Warburg (Otto Heinrich)=C2=A0=3D=3D=3D=3D=3D=3D
    > ```
    >=20
    > So I modified the filter to add a new condition :=C2=A0
    > ```
    > function Div (div)
    > local custom_style =3D div.attributes['custom-style']
    > if custom_style then
    > if custom_style =3D=3D 'mots' then
    > local pre =3D pandoc.RawBlock('dokuwiki', '=3D=3D=3D= =3D=3D=3D')
    > local post =3D pandoc.RawBlock('dokuwiki', '=3D=3D=3D= =3D=3D=3D')
    > else
    > local pre =3D pandoc.RawBlock('dokuwiki', '<WRAP &#= 39; .. custom_style .. '>')
    > local post =3D pandoc.RawBlock('dokuwiki', '</WRAP&= gt;')
    > end
    > local content =3D div.content
    > table.insert(content, 1, pre)
    > table.insert(content, post)
    > return content
    > end
    > end
    > ```
    >=20
    > Well, it doesn't work in many ways :
    > - first, it tells me that=C2=A0
    > Block, list of Blocks, or compatible element expected, got Blocks
    > I guess my condition is badly formed.
    >=20
    > - then if I just try to test it without the added (and buggy) cond= ition,
    > ```
    > function Div (div)
    > local custom_style =3D div.attributes['custom-style']
    > if custom_style then
    > local pre =3D pandoc.RawBlock('dokuwiki', '=3D=3D=3D= =3D=3D=3D')
    > local post =3D pandoc.RawBlock('dokuwiki', '=3D=3D=3D= =3D=3D=3D')
    > local content =3D div.content
    > table.insert(content, 1, pre)
    > table.insert(content, post)
    > return content
    > end
    > end
    > ```
    > I get=E2=80=A6 a block
    > ```
    > =3D=3D=3D=3D=3D=3D
    > Warburg (Otto Heinrich)
    >=20
    > =3D=3D=3D=3D=3D=3D
    > ```
    > which doesn't convert to a proper level 1 title in dokuwiki.
    >=20
    > I understand that my desired modification is inline whereas the or= iginal filter
    > is designed to manage blocks but my lack of knowledge in lua lets = me struggling
    > to go past that.
    >=20
    > Could you please show me the way to do this ?
    > Thanks.
    >=20
    > Le mardi 27 juin 2023 =C3=A0 12:21:20 UTC+2, Sigismond a =C3=A9cri= t=C2=A0:
    >=20
    > Thank you Bastien.
    > I did not find a bug report that specifically treats this issu= e. Many other
    > issues with dokuwiki and lists though.
    > So that's [1]a bug report #8920
    >=20
    > Le mardi 27 juin 2023 =C3=A0 11:53:48 UTC+2, Bastien DUMONT a = =C3=A9crit=C2=A0:
    >=20
    > I think that it is worth a bug report if it has not been d= one yet. As a
    > workaround, you can expand the filter to remove all divs w= ith
    > custom-style from the bullet lists.
    >=20
    > ```
    > function Div (div)
    > local custom_style =3D div.attributes['custom-style= 9;]
    > if custom_style then
    > local pre =3D pandoc.RawBlock('dokuwiki', '<= ;WARP "' .. custom_style ..
    > '">')
    > local post =3D pandoc.RawBlock('dokuwiki', '&l= t;/WARP>')
    > table.insert(div.content, post)
    > table.insert(div.content, 1, pre)
    > return div.content
    > end
    > end
    >=20
    > local remove_custom_styles =3D {
    > Div =3D function(div)
    > if div.attributes['custom-style'] then
    > return div.content
    > end
    > end
    > }
    >=20
    > function BulletList(list)
    > -- Do the same for all types that are badly handled with d= ocx+styles
    > -- (e.g. OrderedList)
    > return list:walk(remove_custom_styles)
    > end
    >=20
    > return {
    > -- We must process the bullet lists first to remove the di= vs
    > -- before they are converted to raw code.
    > { BulletList =3D BulletList },
    > { Div =3D Div }
    > }
    >=20
    > ```
    >=20
    > Le Tuesday 27 June 2023 =C3=A0 02:35:06AM, Sigismond a =C3= =A9crit :
    > > Well=E2=80=A6 it does work but, somehow, docx+styles = messes with the lists :
    > > For a simple docx with just one list, unordered here = is what I get
    > with -f
    > > docx+styles -t dokuwiki :
    > > <HTML><ul></HTML>
    > > <HTML><li></HTML><HTML><p&= gt;</HTML>Liste 1<HTML></p></HTML>
    > > <HTML></li></HTML>
    > > <HTML><li></HTML><HTML><p&= gt;</HTML>liste 2<HTML></p></HTML>
    > > <HTML></li></HTML>
    > > <HTML><li></HTML><HTML><p&= gt;</HTML>liste 3<HTML></p></HTML>
    > >
    > > <HTML><ul></HTML>
    > > <HTML><li></HTML><HTML><p&= gt;</HTML>liste 3a<HTML></p></HTML>
    > > <HTML></li></HTML>
    > > <HTML><li></HTML><HTML><p&= gt;</HTML>liste 3b<HTML></p></HTML>
    > > <HTML></li></HTML>
    > > <HTML><li></HTML><HTML><p&= gt;</HTML>liste 3c<HTML></p></HTML>
    > > <HTML></li></HTML><HTML></= ul></HTML>
    > > <HTML></li></HTML>
    > > <HTML><li></HTML><HTML><p&= gt;</HTML>liste 4<HTML></p></HTML>
    > > <HTML></li></HTML><HTML></= ul></HTML>
    > >
    > > Which is not parsed by dokuwiki.
    > >
    > >
    > > Without +styles :
    > > =C2=A0 * Liste 1
    > > =C2=A0 * liste 2
    > > =C2=A0 * liste 3
    > > =C2=A0 =C2=A0 * liste 3a
    > > =C2=A0 =C2=A0 * liste 3b
    > > =C2=A0 =C2=A0 * liste 3c
    > > =C2=A0 * liste 4
    > >
    > > Which is syntactically correct dokuwiki format.
    > >
    > > If I understand it well, Pandoc seems to consider an = ordered list
    > badly
    > > formatted only when +styles is applied and it spits o= ut some raw html
    > with <p>
    > > tags inside <li>s
    > >
    > > So what is it ? Bad implementation in Dokuwiki writer= ?=C2=A0
    > > How can I benefit from both +styles, with my lua filt= er, and lists ?=C2=A0
    > >
    > > --
    > > =C2=A0 Pascal
    > > Le lundi 26 juin 2023 =C3=A0 16:04:17 UTC+2, Sigismon= d a =C3=A9crit=C2=A0:
    > >
    > > Thanks a lot Bastien, it works perfectly well.
    > >
    > > Le lundi 26 juin 2023 =C3=A0 15:47:00 UTC+2, Bastien = DUMONT a =C3=A9crit=C2=A0:
    > >
    > > With `-f docx+styles`, you can replace the divs with = custom styles
    > with
    > > this kind of filter:
    > >
    > > ```
    > > function Div (div)
    > > local custom_style =3D div.attributes['custom-sty= le']
    > > if custom_style then
    > > local pre =3D pandoc.RawBlock('dokuwiki', = 9;<WARP "' .. custom_style ..
    > > '">')
    > > local post =3D pandoc.RawBlock('dokuwiki', &#= 39;</WARP>')
    > > local content =3D div.content
    > > table.insert(content, 1, pre)
    > > table.insert(content, post)
    > > return content
    > > end
    > > end
    > > ```
    > >
    > > Le Monday 26 June 2023 =C3=A0 06:16:48AM, Sigismond a= =C3=A9crit :
    > > > OK, let's try it another way :
    > > >
    > > > I plan to use Pandoc to convert several docx fil= es to dokuwiki
    > > format.
    > > > I need to retain custom block styles and convert= them to custom
    > tags,
    > > something
    > > > like=C2=A0
    > > >
    > > > <WARP my-custom-block-style>
    > > > my dokuwiki formatted block text
    > > > </WARP>
    > > >
    > > > Do I need to develop a custom dokuwiki writer fr= om scratch to do
    > that
    > > or is
    > > > there a way to use lua filters for this purpose.
    > > > Sorry if the answer is obvious but I struggle to= find relevant
    > > information.
    > > >
    > > > Thanks for any help,
    > > > --
    > > > =C2=A0 Pascal
    > > >
    > > >
    > > > Le mercredi 26 avril 2023 =C3=A0 16:14:20 UTC+2,= pascal Conil-lacoste a
    > > =C3=A9crit=C2=A0:
    > > >
    > > > Hi everybody,
    > > >
    > > > I've been using pandoc for some years to acc= omplish very
    > > straightforward
    > > > conversions.
    > > > Now that what I plan to do is a little more comp= lex, I struggle to
    > > find
    > > > relevant information.
    > > >
    > > > I need to convert docx to dokuwiki and retain Wo= rd custom styles. I
    > > thought
    > > > I could use docx+styles to get custom-styles in = dokuwiki files but
    > > they
    > > > don't make it to the output and get stripped= .
    > > >
    > > > I would be happy with ::: {custom-style=3D"= myStyle"} my text here:::
    > > >
    > > > If I could get something along these lines, I wo= uld be able to
    > apply
    > > some
    > > > other simple transformation to get to the final = dokuwiki files and
    > > treat
    > > > them with a plugin.
    > > >
    > > > What is the best way to achieve this ? Filters ?= Templates ?
    > > >
    > > > Any help welcome!
    > > >
    > > > --
    > > > You received this message because you are subscr= ibed to the Google
    > > Groups
    > > > "pandoc-discuss" group.
    > > > To unsubscribe from this group and stop receivin= g emails from it,
    > > send an email
    > > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
    > > > To view this discussion on the web visit [2][1]h= ttps://
    > > [2]groups.= google.com/d/msgid/
    > > > pandoc-discuss/bdc377c4-3918-4f0f-a87e-a66f9d128= cc2n%[2]
    > > [3]40googlegroups.com.
    > > >
    > > > References:
    > > >
    > > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
    > > > [2] [3][4]https://groups.google.com/d/msgid/pand= oc-discuss/
    > > bdc377c4-3918-4f0f-a87e-a66f9d128cc2n%[5]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 ema= ils from it,
    > send an email
    > > to [4]pand= oc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
    > > To view this discussion on the web visit [5][6]https:= //
    > groups.google.c= om/d/msgid/
    > > pandoc-discuss/f0b95670-24a3-4870-842f-fb6e7791a694n%= [7]
    > 40googlegroups.com.
    > >
    > > References:
    > >
    > > [1] [8]https://groups.google.com/d/msgid/
    > > [2] [9]http://40google= groups.com/
    > > [3] [10]https://groups.google.com/d/msgid/pandoc-disc= uss/
    > bdc377c4-3918-4f0f-a87e-a66f9d128cc2n%40googlegroups.com?utm_medium=3D
    > email&utm_source=3Dfooter
    > > [4] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
    > > [5] [11]https://groups.google.com/d/msgid/pandoc-disc= uss/
    > f0b95670-24a3-4870-842f-fb6e7791a694n%40googlegroups.com?utm_medium=3D
    > email&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 [12]pandoc-discus...= @googlegroups.com.
    > To view this discussion on the web visit [13]https://groups.google.com/d/msgid/
    > pandoc-discuss/62b0db64-b7ab-48e8-9025-9c969304e1b6n%40googlegroups.com.
    >=20
    > References:
    >=20
    > [1] https://github.com/jgm/pandoc/issues/8920
    > [2] http://groups.googl= e.com/d/msgid/
    > [3] http://40googlegroups.com/
    > [4] https://groups.google.com/d/msgid/pandoc-discuss/
    > [5] http:= //40googlegroups.com/?utm_medium=3D
    > [6] https://groups.= google.com/d/msgid/
    > [7] http://40googlegroups.com/
    > [8] https://groups.= google.com/d/msgid/
    > [9] http://40googlegroups.com/
    > [10] https://group= s.google.com/d/msgid/pandoc-discuss/bdc377c4-3918-4f0f-a87e-a66f9d128cc2n%4= 0googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
    > [11] https://group= s.google.com/d/msgid/pandoc-discuss/f0b95670-24a3-4870-842f-fb6e7791a694n%4= 0googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
    > [12] mailto:pandoc-disc= us...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
    > [13] https://group= s.google.com/d/msgid/pandoc-discuss/62b0db64-b7ab-48e8-9025-9c969304e1b6n%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/48c40b5c-7f08-4c57-b7dd-45ae7accce9dn%40googlegroups.= com.
    ------=_Part_14237_2077473316.1688044267167-- ------=_Part_14236_58494219.1688044267167--