Django

Code

Changeset 6223

Show
Ignore:
Timestamp:
09/14/07 16:46:38 (1 year ago)
Author:
adrian
Message:

Fixed #4658 -- Improved documentation of linebreaks and linebreaksbr. Thanks, ubernostrum and Gary Wilson

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/template/defaultfilters.py

    r6019 r6223  
    255255 
    256256def linebreaks(value): 
    257     "Converts newlines into <p> and <br />s" 
     257    """ 
     258    Replaces line breaks in plain text with appropriate HTML; a single 
     259    newline becomes an HTML line break (``<br />``) and a new line 
     260    followed by a blank line becomes a paragraph break (``</p>``). 
     261    """ 
    258262    from django.utils.html import linebreaks 
    259263    return linebreaks(value) 
     
    261265 
    262266def linebreaksbr(value): 
    263     "Converts newlines into <br />s" 
     267    """ 
     268    Converts all newlines in a piece of plain text to HTML line breaks 
     269    (``<br />``). 
     270    """ 
    264271    return value.replace('\n', '<br />') 
    265272linebreaksbr = stringfilter(linebreaksbr) 
  • django/trunk/docs/templates.txt

    r6184 r6223  
    11361136~~~~~~~~~~ 
    11371137 
    1138 Converts newlines into ``<p>`` and ``<br />`` tags. 
     1138Replaces line breaks in plain text with appropriate HTML; a single 
     1139newline becomes an HTML line break (``<br />``) and a new line 
     1140followed by a blank line becomes a paragraph break (``</p>``). 
    11391141 
    11401142linebreaksbr 
    11411143~~~~~~~~~~~~ 
    11421144 
    1143 Converts newlines into ``<br />`` tags. 
     1145Converts all newlines in a piece of plain text to HTML line breaks 
     1146(``<br />``). 
    11441147 
    11451148linenumbers