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 Lua
filter it renders this structure:
```
Scope
Test body
Test nested
```
And with filter below it fails on line 8 w/ this error "Inline, list of
Inlines, or string expected, got Blocks"... any idea on how to troubleshoot
such issues?:
```
return {
{
Div = function (div)
if (div.attributes['custom-style'] == 'Internal Heading') then
return pandoc.Header(2, div.content[1].content)
end
if (div.attributes['custom-style'] == '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 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'] == 'Internal Heading' then
> return pandoc.Header(2, div.content[1].content)
> end
> end
> ```
>
> Le Thursday 16 February 2023 à 08:00:08PM, Ben Menashe a écrit :
> > Hi,
> > We have a need to convert docx to gfm.
> > Since docx has some user defined styles we use this "+styles" extension:
> >
> >
> > pandoc --to=gfm -f docx+styles --output=rtb.md --extract-media=.
> --wrap=none
> > 'rtb.docx'
> >
> >
> > So now we have html div that wraps our content. Let's say I want 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 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]
> https://groups.google.com/d/msgid/
> > pandoc-discuss/3909f520-e8db-4cf9-900d-6a5a858c1a18n%40googlegroups.com.
> >
> > References:
> >
> > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [2]
> https://groups.google.com/d/msgid/pandoc-discuss/3909f520-e8db-4cf9-900d-6a5a858c1a18n%40googlegroups.com?utm_medium=email&utm_source=footer
>
>
--
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 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/52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en%40googlegroups.com.