Tags:
create new tag
, view all tags

Bug: Broken rendering in textarea fields of TWiKi forms

When creating a TWiKi Form with an input of type textarea and using TWiKi syntax for formatting text (such as item list), the preview and view functions do not give the expected result (item list do not work at all, header work if not in the first line and so on).

Test case

Try the following test in a textarea input of a TWiki form. The first does not work at all and the second works except for the first line.

essai :
   1 toto
   1 titi
   * premier
   * second

Is rendered as:

essai :

  1. toto
  2. titi
  • premier
  • second

---+ Bof
---++ plus
---++ moins

Is rendered as:

Bof

plus

moins

Environment

TWiki version: 01 Feb 2003
TWiki plugins:  
Server OS: Linux (debian)
Web server: Apache
Perl version: 5.8.0
Client OS: Linux (debian)
Web Browser: mozilla

-- XavierREDON - 11 Apr 2003

Follow up

I added a second copy of your test text outside of verbatim tags to see how it renders — I don't understand the problem — it seems to render as I'd expect it to.

Maybe you wanted the first test to render a definition list item, like this:

essai
This is a definition of essai.
  1. toto
  2. titi
  • premier
  • second

If so, here's how I marked that up:

   essai: This is a definition of essai.
   1 toto
   1 titi
   * premier
   * second

Or maybe you didn't want the blank line between essai: and the first numbered list item, nor between the last numbered list item and the first bullteted list item?

I'm not trying to be difficult, I just don't understand the problem, and don't want to see the behavior of TWiki change unexpectedly — how does your change affect these renderings?

Of course, it won't matter unless somebody decides to add your change to the "official" TWiki -- guess I'm just curious.

-- RandyKramer - 11 Apr 2003

The examples below are rendered very well in the main textarea of a TWiKi topic but not in a textarea of a TWiKi form (stored as meta-data). Try for example to create a form with the following table :

Name Type Size Values Tooltip message
FichesFormFrenchGoal textarea     Les objectifs à atteindre (français)
FichesFormFrenchContent textarea     Programme détaillé de l'enseignement (français)
FichesFormFrenchDepend textarea     Pré-requis nécessaires pour suivre l'enseignement (français)

Then try to type my examples in the two first textarea fields of the form.

Sorry for the bad explanation, my changes have no impact on the rendering of the main textarea input, only the rendering of textarea in a TWiKi form.

-- XavierREDON - 12 Apr 2003

Fix record

This can be fixed by :

  • putting two \n around $value at line 2145 of TWiki.pm (each field value must begin on a new line) ;
  • adding the line $value =~ s/ {3}/\t/go; before line 2145 of TWiki.pm (rendering works only with tabs) ;
  • adding the line $value =~ s/\t/   /go; after line 267 of TWiki/Form.pm (form default values must include spaces);
  • adding the line $value =~ s/ {3}/\t/go; after line 253 of TWiki/Meta.pm (form values must be saved with tabs).

Sorry my previous fix was bugged.

- XavierREDON - 11 Apr 2003

Sorry, I didn't pick up on the idea that this was a text area within a form. I haven't really used forms so far, my private TWiki still uses the old "category" thingie (whatever it was called).

-- RandyKramer - 12 Apr 2003

Hello, I am experiencing a similar issue around redering TWiki formatted text from within forms. Does the fix above still apply to the latest version (or Cairo) Thanks.

-- AndyBush - 09 Nov 2005

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2008-09-02 - TWikiJanitor
 
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.