Add/rework the options for {% attr %} and {% definevar %}.

Review Request #9055 — Created July 5, 2017 and submitted — Latest diff uploaded

Information

Djblets
release-0.10.x
5e73690...

Reviewers

My recent change added some control over stripping to {% definevar %}
and made stripping mandatory for {% attr %}. This change builds upon
that by refining the behavior and adding more options.

{% attr %} now condenses the whitespace within the value by default
(turning sequences of spaces, tabs, and newlines into a single space).
All the new behavior can be turned off with the "nocondense" option.

It also now marks the value as unsafe, instead of making that the
caller's responsibility.

{% definevar %} now has a strip option for stripping
leading/trailing whitespace (replacing the new stripped), a
spaceless option for making the text spaceless (equivalent to wrapping
the value within as {% spaceless %}), and an unsafe option for
marking the value as unsafe.

Along with this (and to support these options), @blocktag now works with
template tags taking *args. When found, the check for the maximum number
of arguments will be turned off.

Unit tests passed.

    Loading...