[ZCM] [ZC] 395/ 2 Comment "xhtml newline_to_br into DT_Var"

Collector: Zope Bugs, Features, and Patches ... zope-coders@zope.org
Fri, 17 May 2002 13:20:25 -0400


Issue #395 Update (Comment) "xhtml newline_to_br into DT_Var"
 Status Pending, Zope/feature+solution medium
To followup, visit:
  http://collector.zope.org/Zope/395

==============================================================
= Comment - Entry #2 by stevea on May 17, 2002 1:20 pm

Seeing as '\n' and '\r' are single character, you could also change the lines:

  if v.find('\r') >= 0: 
  if v.find('\n') >= 0:

to:

  if '\r' in v:
  if '\n' in v:

also, I'm not sure why this code isn't using ''.replace rather than a split and join.
________________________________________
= Request - Entry #1 by Anonymous User on May 16, 2002 11:40 pm

At line 303 of DT_Var.py, replace <br> by <br />: 

if v.find('\n') >= 0: v='<br />\n'.join(v.split('\n'))
==============================================================