Specification of text format handling in KOM 2000

By Jacob Palme 24 September 1998.

A new row of radio buttons is added immediately above the window for writing a text. This row could look like this:

Text format: Automatic    Fixed width    HTML

The HTML behind this could be:

<P>Text format: <INPUT TYPE="RADIO" NAME="textform" VALUE="auto" CHECKED>
Automatic&nbsp;&nbsp;&nbsp;
<INPUT TYPE="RADIO" NAME="textform" VALUE="fixed">Fixed width&nbsp;&nbsp;&nbsp;
<INPUT TYPE="RADIO" NAME="textform" VALUE="html"> HTML


The value, which the user sets to textform must be saved, since if the user opens a window to modify the text, the same setting should be default (CHECKED) for the modification window.

Automatic could work in the same way as KOM 2000 does today, i.e. trying to guess if the text contains HTML elements, wrapping words, inserting a <P> for every blank line.

HTML shoud take the text as specified by the user, treat it as HTML, but not modify it in any way.

Fixed should let the whole message become preformatted, with line breaks where the user specifies them, but no other modification of what the user has written

When an existing text is to be modified, the following conversion of the existing text should be done before writing it into the text window:

Å &Aring;
Ä &Auml;
Ö &Ouml;
å &aring;
ä &auml;
ö &ouml;
< &lt;
> &gt;
& &amp;
" &quot;





There may be more characters which needs special conversion, than those listed to the left.


Example:

If the user has typed the following in the text input area:

Enter the text...
<=Less than character
>Greater than character
"=Double-blip character
&=Ampersand character
Å=A with ring
Ä=A with two dots
Ö=O with two dots
å=a with ring
ä=a with two dots
ö=o with two dots
<B>Bold text</B>

Then, when the user is to modify this text, using for example the "Preview" or "Edit message" commands, you must put the following into the <TEXTAREA>:

<TEXTAREA NAME="body" ROWS="30" COLS="70" wrap>
&lt;=Less than character
&gt;Greater than character
&quot;=Double-blip character
&amp;=Ampersand character
&Aring;=A with ring
&Auml;=A with two dots
&Ouml;=O with two dots
&aring;=a with ring
&auml;=a with two dots
&ouml;=o with two dots
&lt;B&gt;Bold text&lt;/B&gt;
</TEXTAREA>