Changeset 6223
- Timestamp:
- 09/14/07 16:46:38 (1 year ago)
- Files:
-
- django/trunk/django/template/defaultfilters.py (modified) (2 diffs)
- django/trunk/docs/templates.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/template/defaultfilters.py
r6019 r6223 255 255 256 256 def 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 """ 258 262 from django.utils.html import linebreaks 259 263 return linebreaks(value) … … 261 265 262 266 def 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 """ 264 271 return value.replace('\n', '<br />') 265 272 linebreaksbr = stringfilter(linebreaksbr) django/trunk/docs/templates.txt
r6184 r6223 1136 1136 ~~~~~~~~~~ 1137 1137 1138 Converts newlines into ``<p>`` and ``<br />`` tags. 1138 Replaces line breaks in plain text with appropriate HTML; a single 1139 newline becomes an HTML line break (``<br />``) and a new line 1140 followed by a blank line becomes a paragraph break (``</p>``). 1139 1141 1140 1142 linebreaksbr 1141 1143 ~~~~~~~~~~~~ 1142 1144 1143 Converts newlines into ``<br />`` tags. 1145 Converts all newlines in a piece of plain text to HTML line breaks 1146 (``<br />``). 1144 1147 1145 1148 linenumbers
