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

Re: BUG REPORT: Website META Language 1.99.1 (16-Mar-2000)



On Sun, Mar 19, 2000 at 04:53:49PM +0100, Denis Barbier wrote:
> On Fri, 17 Mar 2000, Anthony Fok wrote:
> 
> >     wml_p1_ipp would fail if the input file (or its included files) contains
> > 
> > 	?$(name)
> 
> Oooops i forgot to fix it in 1.99.2.
> You may find a new ipp.src in wml-SNAP which fixes this bug and
> introduces important changes in new features.

Thanks for the fix!  My pages now builds without problems with the new
1.99.3.  :-)

> >     Also, the "$" is escaped if preceded by a "\" regardless of the number
> >     of "\"s.
> 
> In fact, it is handled this way at least since WML 1.6.7, so i assumed
> it was a well-known feature.

Yes, indeed, and I am glad that \$(name) works the way it does.  What I was
wondering was, what if someone wants to things like:

	<KBD>EDIT C:\WINDOWS\SYSTEM.INI</KBD>

where filename="SYSTEM.INI" in this example.  Obviously,

	<KBD>EDIT C:\WINDOWS\$(filename)</KBD>

wouldn't work, and that's a good thing.  What I was suggesting in the last
e-mail was that perhaps the user could code it like this instead:

	<KBD>EDIT C:\WINDOWS\\$(filename)</KBD>

so that for the two backslashes before the "$", the first backslash would
escape the second backslash, so that the second backslash wouldn't escape
the "$".  :-)

But then, after reading your reply, I realized my error.  I was advocating
that "\" would *always* act as an escape character all the time, so "\\" in
the input would always become "\" in the output.  And of course, that would
be very bad indeed.  :-) Someone who wanted "\\//\\//\\//\\//" would end up
with "\//\//\//\//", and Chinese Big5-encoded characters might be messed up
too because some character uses "\".  I know, Big5 = bad encoding.  :-)

What I was wondering though, would you like to implement a special case for
things like \\$(name), similar to what is already implemented for
\\<newline>, so <KBD>EDIT C:\WINDOWS\\$(filename)</KBD> would work?

(But then, I haven't seen anyone bringing this up on this mailing list, so I
guess no one ran into this problem?  :-) For the record, I never ran into
the problem or the need to deal with DOS path names.  The above is just an
example that I made up for this discussion.  :-)

Anyway, I did some more experimenting, and came up with some workarounds for
the time being.  :-)

with mhc or mp4h:

	<define-tag backslash>\</define-tag>
	<KBD>EDIT C:\WINDOWS<backslash>$(filename)</KBD>

with eperl:

	<KBD>EDIT C:\WINDOWS<:="\\":>$(filename)</KBD>

with asubst:

	<KBD>EDIT C:\WINDOWS{:[[s%/%\\%]]/:}$(filename)</KBD>

or more simply:

	<KBD>EDIT C:\WINDOWS{:\:}$(filename)</KBD>

So, my last question is: If you think that implementing \\$(name) is
bad idea, what would be your way (or the "official" way) to do this?  :-)

(You must be wondering, "What is this guy up to anyway?" eh?  :-)
I don't know!  Haha, I am just amused that {:\:} would work.  :-)

Anthony

-- 
Anthony Fok Tung-Ling                Civil and Environmental Engineering
foka@ualberta.ca, foka@debian.org    University of Alberta, Canada
Come visit Our Lady of Victory Camp -- http://www.olvc.ab.ca/
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com