Re: Amaya 9.3 RC bug: span within a span

On Sunday 04 December 2005 23:17, Bartolomé Sintes Marco wrote:
> Hi,
>
> In Amaya 9.3 RC, a span element is not properly created if the selected
> text already contains a span.
>
> Steps to reproduce
> 1. Write some text
>     example: <p>One two three four five</p>
> 2. Select some text and create a span element giving it a class
>     example: <p>One two <span class="first">three</span> four five</p>
>     By the way, after the creation of the span, the attribute window
>     shows the class atribute until another element is selected using F2.
> 3. Select some text containing a span element and create another span
>     expected: <p>One <span class="second">two <span
>                  class="first">three</span> four</span> five</p>
>     result: <p>One <span class="second">two </span><span
>
>             class="second">three</span><span
>             class="second"> four</span> five</p>
>     The first class has disappeared. 

The solution is to generate an enclosing <span> where selected elements can be 
included into a <span>. This solution won't be implemented in 9.3 version, 
but we'll working on it in next future version.


>     By the way, the white spaces have 
>     also disappeared, but this is an old bug I have reported several
>     times.

This is not a bug. See "About White Space Handling" in Help>Characters
 
Amaya removes insignificant white-space characters when it loads a document 
unless they must be explicitly preserved. This is true for XHTML, MathML, and 
SVG documents, as well as MathML or SVG elements included in a HTML document,

The following are considered as insignificant white-space characters:

    o End of line characters (#xD and #xA)
    o Tab characters (#X9)
    o Leading spaces of an element
    o Trailing spaces of an element
    o Contiguous spaces (one space is preserved)

To preserve all the characters for some elements, use the xml:space attribute 
or the PRE element (only valid for XHTML documents). The possible values for 
the xml:space attribute are default and preserve.

    o The value default means that an applications' default white-space 
treatment is acceptable for these elements. In Amaya, the default treatment 
removes the insignificant white-space characters for all supported DTDs (see 
above).
    o The value preserve indicates that applications will preserve all the 
characters, except the first one that immediately follows the end tag of the 
element where it is specified, if that element is an end of line.

You apply the xml:space attribute to all elements within the content of the 
element where it is specified, unless it is overriden with another instance 
of the xml:space attribute.

In an XHTML DTD, the PRE element causes the same behavior as the xml:space 
attribute with the value preserve.

Amaya applies white space handling when it loads a document, not during 
editing. A consequence is that if you type insignificant white-space 
characters, they will be visible and saved but will be removed the next time 
the document is loaded. For example, the following source code:

<p>Amaya removes the <strong> insignificant white-space </strong>when it 
loads ...</p>

displays as follows during editing:

Amaya removes the insignificant white-space when it loads...

The text will be saved with that syntax. However, the next time the document 
is loaded, the text will display as:

Amaya removes theinsignificant white-spacewhen it loads...

because the leading and trailing spaces of the element <strong> are considered 
to be insignificant and are removed.

The correct source code would be:

<p>Amaya removes the <strong>insignificant white-space</strong> when it 
loads ...</p>

> Best regards,
> Bartolomé Sintes (http://www.mclibre.org)


     Irène.
-----
Irène Vatton                     INRIA Rhône-Alpes
INRIA                               ZIRST
e-mail: Irene.Vatton@inria.fr       655 avenue de l'Europe
Tel.: +33 4 76 61 53 61             Montbonnot
Fax:  +33 4 76 61 52 07             38334 Saint Ismier Cedex - France

Received on Tuesday, 6 December 2005 09:11:58 UTC