If a text area starts with text in it, TWiki will insert html such as <p />.
Test case at
LitterTray.TextAreaTest.
--
TWiki:Main/AndrewRJones
- 13 Mar 2007
Thought I would have a quick go to fix this myself. This little patch to Render.pm seems to work, and it still expands variables such as %MAINWEB%.
908d907
< my $removedTextarea = {};
921,922d919
< $text = $this->takeOutProtected( $text, qr/<textarea\b.*?<\/textarea>/si,
< $removedTextarea );
1160d1156
< $this->putBackProtected( \$text, $removedTextarea );
--
TWiki:Main.AndrewRJones
- 13 Mar 2007
Thanks for the report and the patch - a context-diff patch would be more useful though, please see
TWiki:Codev.PatchGuidelines
.
--
TWiki:Main.RichardDonkin
- 14 Mar 2007
Ok, here's a new patch using diff -c:
***************
*** 905,911 ****
my $removedComments = {};
my $removedScript = {};
my $removedHead = {};
- my $removedTextarea = {};
my $removedVerbatim = {};
my $removedLiterals = {};
--- 905,910 ----
***************
*** 918,925 ****
$removedComments );
$text = $this->takeOutProtected( $text, qr/<head.*?<\/head>/si,
$removedHead );
- $text = $this->takeOutProtected( $text, qr/<textarea\b.*?<\/textarea>/si,
- $removedTextarea );
$text = $this->takeOutProtected( $text, qr/<script\b.*?<\/script>/si,
$removedScript );
--- 917,922 ----
***************
*** 1157,1163 ****
$this->putBackProtected( \$text, $removedHead );
$this->putBackProtected( \$text, $removedComments );
- $this->putBackProtected( \$text, $removedTextarea );
$this->{session}->{client}->endRenderingHandler( $text );
$plugins->postRenderingHandler( $text );
--- 1154,1159 ----
--
TWiki:Main.AndrewRJones
- 15 Mar 2007
commited to MAIN, with unit test.
--
TWiki:Main.SvenDowideit
- 23 Mar 2007
Would this be a potential patch release fix also?
Or is it perhaps a risky fix with respect to compatibility?
--
TWiki:Main.KennethLavrsen
- 23 Mar 2007
I don't think its a risky fix, in fact, done
--
TWiki:Main.SvenDowideit
- 23 Mar 2007
Argh, this is hopeless. I have a plugin (and I am sure there are others) that tries to put a textarea into the text. But this change eats it!
Re-opening as urgent, as it breaks existing plugins.
To try it, just insert
| <textarea> XYZ </textarea> |
in a
commonTagsHandler
.
CC
See also:
Item3874 for possibly related problem.
--
TWiki:Main.CrawfordCurrie
- 13 Apr 2007
I added a unit test, and it seems to be working OK now, at least with my plugins. Need to keep an eye on this one, though!
CC