[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: bug in 1.7.0?

On Thu, 3 Jun 1999, John Bazik wrote:

> Here's a trivial .wml file:
> 	#use wml::des::space
> 	<space width=3 height=3>
> Here's what I get under 1.6.8 (on a linux box):
> 	<img src="test.imgdot-1x1-transp.gif" alt="" width="3" height="3"
> 	align="bottom" border="0">
> Here's what I get under 1.7.0 (on a sun):
> 	<img src="test.imgdot-1x1-transp.gif" alt="" width="1" height="1"
> 	align="bottom" border="0">
> Can anyone else reproduce this?

Yes, i do.
One trivial workaround is to replace the definition of the <space> tag
in wml::des::space by
<define-tag space>
<imgdot %attributes>

> I spent some time trying to track this down.  The "3" seems to get
> lost in pass 2 - the perl code in imgdot never sees it.
> I tried this:
> 	#use wml::std::tags
> 	<define-tag mytag2>
> 	<preserve width>
> 	<set-var %attributes>
> 	in mytag2, width is <get-var width>
> 	<restore width>
> 	</define-tag>
> 	<define-tag mytag>
> 	<preserve width>
> 	<set-var %attributes>
> 	in mytag, width is <get-var width>
> 	<mytag2 width=<get-var width>>
> 	<restore width>
> 	</define-tag>
> 	<mytag width=3>
> Strangely, the results are the same under both 1.6.8 and 1.7.0:
> 	in mytag, width is 3
> 	in mytag2, width is
> Again, does anyone else see this?  This is not right, is it?

This is a ``normal'' behavior. When <mytag> is called,
%attributes="width=<get-var width>" and not "width=3"!
Then when <preserve width> is called, the ``width'' variable is
initialized to null. After that <set-var width=<get-var width>>
does what you see.

I believe there was a bug in Meta-HTML 5.02 (wml-1.6.8) fixed in version
5.09 (included in wml-1.7.0).
Indeed, you may try
   .../bin/wml -p1 foo.wml > foo.mhtml
   ..../lib/wml/exec/wml_p2_mhc foo.mhtml
Mix wml_p2_mhc and wml from WML-1.6.8 and WML-1.7.0 and you'll find the
problem comes from Meta-HTML 5.09.

Again, this is the normal behavior, and calls like
   <imgdot width=<get-var width>>
are hazardous.
Another workaround is to define <imgdot> as:
  <define-function imgdot>
  <preserve base>
  <preserve width>
  <preserve height>
  <preserve color>
  <preserve align>
  <preserve noscale>
  <set-var noscale=*>
  <set-var %xbody>

2 points:
- Removed the whitespace=delete attribute, because perl scripts may
  be written on a single line which may cause problems.
- Replace %0 %1 ... %9 by %xbody
  This variable is like %attributes, but is expanded.

I do not recommend using this syntax, i'm not sure it is really safe.

I planned to check all include files in the wml-1.7.1 release

Thanks for this report.


Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com