g-plane / markup_fmt

Configurable HTML, Vue, Svelte, Astro, Angular, Jinja, Twig, Nunjucks and Vento formatter with dprint integration.
https://dprint.dev/plugins/markup_fmt/
MIT License
100 stars 9 forks source link

Add some missing Jinja blocks #25

Closed UnknownPlatypus closed 5 months ago

UnknownPlatypus commented 5 months ago

Add support for the following jinja blocks set / trans / raw.

I added tests cases using code samples from the jinja documentation about these tags.

I would also like to add support for custom blocks such as {% markdown %}...{% endmarkdown %} (https://github.com/jpsca/jinja-markdown).

Would it be okay to add a custom_blocks configuration allowing people to list custom block they use ? I'm not sure how often this is used in jinja but it's quite common in django (See django documentation on how to implement custom blocks)

UnknownPlatypus commented 5 months ago

Okay makes sense, maybe it could be a simple comma delimited string such as "customBlocks": "myblock,markdown"