Bug: Unwanted newlines in OBJECT, IMG

Following on from the discussion in "Re: Bug report: /> and then </a>
tag on new line" of unwanted newlines at the end of the IMG element, I
find similar problems with the OBJECT element.

Here is a test file with the problem removed by manually editing the
source, in Amaya, to put the whole IMG tag and the whole OBJECT tag,
enclosed text and ending tag on a single line:

  http://www.firstpr.com.au/temp/amaya/amaya-test-32.html

<p>xx<img alt="Photos of Queensland Daintree rainforest and beach" src="show-and-tell-green-ants-310x300.jpg" />yy</p>

<p></p>

<p>aa<object type="image/jpeg" data="show-and-tell-green-ants-310x300.jpg">green ants</object>bb</p>

<p></p>

<p>cc<object type="image/jpeg" data="show-and-tell-green-ants-310x300.jpg"></object>dd</p>

I was able to do this even with the default setting of Preferences >
Publishing > Fixed line length.

This displays in Amaya and in browsers the way I want it - no spaces
between the image and the surrounding text.  So Amaya is perfectly
capable of understanding this form.

However, by editing the top paragraphs in main view, for instance
adding a third 'y' Amaya saves that paragraph and the ones below with
extra newlines, and in one instance some spaces after the newline.
Amaya and browsers correctly render these additions as a space before
"yy", "cc" or "dd".  (This occurs even when Fixed line length is set
to 200.)

The result is:

<p>xx<img alt="Photos of Queensland Daintree rainforest and beach" src="show-and-tell-green-ants-310x300.jpg" />
yyy</p>

<p></p>

<p>aa<object type="image/jpeg" data="show-and-tell-green-ants-310x300.jpg">
  green ants</object>
bb</p>

<p></p>

<p>cc<object type="image/jpeg" data="show-and-tell-green-ants-310x300.jpg">
</object>
dd</p>

As noted in previous messages, Amaya puts a spurious newline after the
end of the "<a ... />" tag.

It does the same thing after the end of the "</object>" tag, with the
same consequences: a space after the image.

Amaya also adds a newline and leading space after the "<object ...> tag.
This has the effect of adding a space before the enclosed text so that
instead (in the original example) of a browser displaying:

aagreen antsbb

when it could not display the object, it displays:

aa green antsbb


I also notice that when inserting an object (XHTML > Object) it is
impossible not to give "alternative text".

In the case of the OBJECT element, this is the text which is enclosed
between the starting and ending tag.  Yet my understanding of the HTML
4.01 spec, including the example in section 13.3.1, is that it is not
compulsory to include any text within the OBJECT tags.


 - Robin

In case someone stumbles on these mailing list archives via a search
engine, the photos of the Daintree rainforest are at:

  http://www.firstpr.com.au/show-and-tell/green-ants/

Received on Monday, 30 October 2006 03:59:53 UTC