mmark-md / mmark

Strict markdown processor for writers
Other
111 stars 20 forks source link

Add CSS classes to rendered elements #70

Closed srid closed 4 years ago

srid commented 4 years ago

What is a good approach to adding CSS classes to elements (eg: <table>) rendered by mmark?

One approach is to fork the renderer code and do it as an extension, as is being tried by @gillchristian in https://github.com/srid/neuron/pull/100 - but obviously there must be a better way that respects DRY?

Just looking at the code it doesn't seem to be possible in its current state. Is there a possibility of improving the library to support such customization? Or is this better done in a different manner?

mrkkrp commented 4 years ago

Hmm, can't you use something like with (old myTable) [class_ tableClass]? Need first to pattern match to do it only for tables.

gillchristian commented 4 years ago

Using with worked. Thanks.

Is it worth to add it as a comment on the Ext.blockRender docs? I assume a common use case for extensions is running customize the rendering of blocks.

Regardless I think this issue could be closed.