tickets: 23356
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23356 | 2014-08-23 22:59:44 | 2021-08-25 11:55:18 | 2022-03-06 04:22:56.493662 | Accepted | assigned | Template system | Cleanup/optimization | Normal | dev | Unable to create template tag which behaves similar to {% verbatim %} | Currently it is impossible to create custom template tags which behave similar to {{{ {% verbatim %} }}}. The reason is in {{{Lexer.create_token()}}}. There, the class member {{{self.verbatim}}} is set for template blocks in "verbatim" state. It is impossible to turn on that state from outside, ie. a template tag. Fixing this, would be as simple as changing {{{if block_content[:9] in ('verbatim', 'verbatim ')}}} to {{{if block_content.startswith('verbatim')}}} or to {{{if block_content[:9] in ('verbatim', 'verbatim ', 'verbatim_')}}}. Then all template tags beginning with verbatim..., would start in "verbatim" state. I don't assume this will break any existing code; who starts the name of a templatetag with 'verbatim...' if not for that purpose? Background information why this is useful: Templates syntax for Django and AngularJS is very similar, and with some caveats it is possible to reuse a Django template for rendering in AngularJS. I therefore attempted to add a context sensitive variation of the verbatim tag to this app https://github.com/jrief/django-angular, but was hindered by this issue. BTW: This part of the Django code did not change from 1.6 up to master. | atul-bhouraskar | jrief | verbatim | 0 | 1 | 1 | 0 | 0 | 0 |