Hi,

I'd like to assign a class to every table in my HTML output. I've got PHP filters working but can't figure out how to manipulate the AST to do what I want.

Building on an example PHP filter, I have:

Pandoc_Filter::toJSONFilter(function ($type, $value, $format, $meta) {
   
if ('Str' == $type) {
       
// use mb_convert_case instead of ucwords so filter works with unicode
       
return mb_convert_case($value, MB_CASE_LOWER, "UTF-8");
   
}
   
if ('Table' == $type) {
        $attrs
= array('classes' => 'table');
       
// return ???
   
}
});

The 'Str' manipulation works as expected, and any code I put into the 'Table' section is executed, but I can't get started on how to proceed from there. Any pointers would be very 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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/553f3670-7cb1-402f-9a92-89f3774d17c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.