#24871: Textarea widget has redundant \r\n when writing XHTML
----------------------------------+------------------------------------
     Reporter:  tompecina         |                    Owner:  nobody
         Type:  Bug               |                   Status:  new
    Component:  Forms             |                  Version:  1.8
     Severity:  Normal            |               Resolution:
     Keywords:  textarea, widget  |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------
Changes (by carljm):

 * stage:  Unreviewed => Accepted


Comment:

 I think a setting to control this is a non-starter, and we can drop it
 from consideration. No other aspect of form widget rendering (or really,
 form behavior in general) is configured via settings. Not to mention Tim's
 objection, which is that a project wide setting fails to account for a
 project which may need both behaviors (eg because it is mostly XHTML5 but
 uses the admin).

 Creating a custom widget subclass is not onerous. I do it all the time,
 for all sorts of reasons. My inclination is that that's an adequate
 solution for this case.

 That said, I wouldn't have any problem with a `prepend_newline` parameter
 to `Textarea` which defaults to `True`. The justification for this is not
 so much XHTML5 specifically, and more just that the automatic new line
 stripping is conceptually odd behavior to begin with, added by browsers to
 workaround careless markup, and it seems reasonable to have a way to avoid
 that workaround and revert to what would otherwise be the straightforward
 intuitive behavior for the `Textarea` widget (that is, leaving the
 provided contents alone).

 I do think the added new line behavior is something that ought to be
 documented regardless. Accepting this ticket on the basis that at least
 docs should be added.

--
Ticket URL: <https://code.djangoproject.com/ticket/24871#comment:9>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.f6d0cd7332963906a5d5084b291ac3c9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to