#35816: Django Template Language doesn't support all float literals
---------------------------------+------------------------------------
     Reporter:  Lily Foote       |                    Owner:  Aryaman
         Type:  Uncategorized    |                   Status:  assigned
    Component:  Template system  |                  Version:  5.1
     Severity:  Normal           |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------
Changes (by Sarah Boyce):

 * component:  Uncategorized => Template system
 * stage:  Unreviewed => Accepted

Comment:

 Thank you! We try to support scientific numbers so we should fix this.
 I believe their is an issue with the regex, this might work
 {{{#!diff
 diff --git a/django/template/base.py b/django/template/base.py
 index ee2e145c04..e0d032f688 100644
 --- a/django/template/base.py
 +++ b/django/template/base.py
 @@ -640,7 +640,7 @@ filter_raw_string = r"""
           )?
   )""" % {
      "constant": constant_string,
 -    "num": r"[-+.]?\d[\d.e]*",
 +    "num": r"[-+.]?\d[\d.e-]*",
      "var_chars": r"\w\.",
      "filter_sep": re.escape(FILTER_SEPARATOR),
 }}}

 Will need a test
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35816#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107019265f2c7db-df6ec66d-1914-45cb-84ef-337481762012-000000%40eu-central-1.amazonses.com.

Reply via email to