RE: <FIG> implies <P>?

Michael Johnson (michaelj@relay.relay.com)
Thu, 13 Jul 95 08:20:39 EDT


>>The FIG tag is a paragraph tag itself.
>>It implys the content is a paragraph on its own.
>>It cannot go into another paragragh like the IMG tag can.
>
>Yes, but *why*. There's no logical reason at all why a figure should
>be a separate paragraph. Wouldn't it be far better to _not_ have
>fig as an implicit paragraph and allow authors to explicitly
>denote a fig (ie.,within <p></p> ) if the semnatics of their document
>demand it.

I can think of one good reason why a FIG implies a paragraph break, which
has to do with HTML semantics, and that is this:

<FIG> can contain tags which implicitly end any current paragraph. Therefore,
something like the following, while it makes sense to an author, would not
be syntactically correct if <FIG> did not imply a paragraph break:

<P>
Some text here to precede the figure.
<FIG align=right src="image-src"><CAPTION>My Figure</CAPTION>
The figure contains a graphic menu with client side hot zones, but for
text-only browsers, we use a plain unordered list:
<UL PLAIN>
<LI><A href="option-1" shape="shape-1">Option one</A>
<LI><A href="option-2" shape="shape-2">Option two</A>
</UL>
</FIG>

In a case like this, the <UL> tag would implicitly end the <P> tag that
contains the <FIG> and the </FIG> tag would then be left hanging, which is
obviously not the intent of the author.

It seems to me that what Ping is objecting to is not really that <FIG> implies
a paragraph break, but that the browser he is using (Arena) renders this by
inserting vertical white space. His objection is not really based on HTML
semantics, but on stylistic issues. He doesn't want to see the flow of the text
broken up just because a figure is needed, which is a valid concern.

I expect this can be gotten around largely by using style sheets. For example,
one could have something like this:

<P class="before.figure">
In 1863 Abraham Lincoln delivered an address on the battlefield at
Gettysburg, Pennsylvania.
<FIG align=right src="gettysburg.jpg">Text of gettysburg address</FIG>
<P class="after.figure">
He began this address with the now-famous phrase <quot>Four score and
seven years ago, our forefathers brought forth on this continent a new
nation</quot>

The style for P.before.figure could suppress the trailing line break and the
style for P.after.figure could suppress the leading line break and top margin.
This would give something like:

In 1863 Abraham Lincoln delivered an address on the
battlefield at Gettysburg, Pennsylvania. He began
this address with the +-----------------------+
now-famous phrase "Four | |
score and seven years | |
ago, our forefathers | |
brought forth on this | |
continent a new nation" | |
+-----------------------+

This would require the browser to remember where it was formatting text before
it encountered the figure in order to join the lines properly, but that
shouldn't be hard.

Michael Johnson
Relay Technology, Inc.