Start adding indent_blocks to the lexer
We're adding a new indent_blocks environment parameter which automatically indents/dedents block contents. This allows us to add indentation to code block contents (which helps readability) while making sure that the output is also indented nicely.
- fixes #178
Checklist:
- [x] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
- [x] Add or update relevant docs, in the docs folder and in code.
- [x] Add an entry in
CHANGES.rstsummarizing the change and linking to the issue. - [x] Add
.. versionchanged::entries in any relevant code docs. - [x] Run
pre-commithooks and fix any issues. - [ ] Run
pytestandtox, no tests failed.
@davidism I've given a stab at https://github.com/pallets/jinja/issues/178, although I got a little stuck at some more complex nested / inline templates. It would be great if you could let me know if you agree with the direction in general (in which case I'd be happy to continue working on this)! Also, if you have any ideas how to proceed with fixing the failing nested test, let me know.
Thank you!
@davidism Any chance to get some feedback on this PR? I'd still be up for continuing the work on it if that's desirable.