Tags:
bugs1Add my vote for this tag create new tag
view all tags

Another inconsistent treatment of newlines in browsers

SectionalEditPlugin ran into another problem with browsers treating newlines differently. You may recall from SomeBrowsersLoseInitialNewlineInTextArea that we had to work around a problem with browsers eating leading newlines in text areas. Now I discovered that Firefox eats leading newlines in hidden input, while IE does not. Look at the experiment below (thanks to CrawfordCurrie for this example):



Result is
Textarea inputHidden input

Browser/version Confirmed/Not confirmed Notes
IE 6.0 Confirmed  
Firefox 1.5 Not confirmed Eats leading and trailing newlines
Konqueror 3.4.2 Not confirmed Eats trailing, but not leading newline

Result in Firefox 1.5:

http://twiki.org/cgi-bin/edit/Codev/SomeBrowsersLoseMoreNewlines?mytestarea=%0D%0Aabc%0D%0A%0D%0Adef%0D%0A%0D%0A&mytesthidden=abc%0D%0A%0D%0Adef

Result in Firefox 1.0.7 on Win XP:

http://twiki.org/cgi-bin/view/Codev/SomeBrowsersLoseMoreNewlines?mytestarea=%0D%0Aabc%0D%0A%0D%0Adef%0D%0A%0D%0A&mytesthidden=abc%0D%0A%0D%0Adef

Result in IE 6.0:

http://twiki.org/cgi-bin/view/Codev/SomeBrowsersLoseMoreNewlines?mytestarea=%0D%0Aabc%0D%0A%0D%0Adef%0D%0A%0D%0A&mytesthidden=%0D%0A%0D%0Aabc%0D%0A%0D%0Adef%0D%0A%0D%0A

FWIW, in the textarea, Konqueror 3.4.2 eats the leading but not the trailing newline.

-- Contributors: ThomasWeigert

Discussion

I am sure this difference does have impact somewhere in TWiki, and will come to bite somebody. This was discovered debugging a problem of SectionalEditPlugin on Firefox.

-- ThomasWeigert - 04 Aug 2006

BasicForm
TopicClassification TWikiDevQuestion
TopicSummary Another problem with browsers treating newlines differently, this time in hidden input
InterestedParties

RelatedTopics

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2006-08-07 - RandyKramer
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.