[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: not expanding $(SOMETHING) in <import> or <fsview>
- From: Denis Barbier <nospam@thanx>
- Date: Thu, 8 Jul 1999 01:14:29 +0200 (CET)
On Wed, 7 Jul 1999, Davor Cengija wrote:
> here's the example:
>
> the_realname.wml
> ----------------
> #use wml::std::page
> #use wml::std::box
> #use wml::imp::all
> <page info title="Test">
> <fsview src="$(WML_SRC_FILENAME)">
> <box>
> <import src="$(WML_SRC_FILENAME)">
> </box>
>
> so, three #use lines on the top of the file
>
> the_realname.html
> -----------------
[...]
> <td bgcolor="#ffe0e0" align="left">
> <pre>
> <page info title="Test">
> <fsview src="$(WML_SRC_FILENAME)">
> <box>
> <import src="$(WML_SRC_FILENAME)">
> </box>
> </pre>
> </td>
> </tr>
> </table>
>
> (see, no #include or #use lines)
[...]
> so... how to force <import> or <fsview> to show #-starting
> lines as well as the other ones?
Ok, i see now where does your problem come from. Try
#use wml::std::page
#use wml::std::box
#use wml::imp::all
<page info title="Test">
<protect pass=4-9>
<fsview src="$(WML_SRC_FILENAME)">
<box>
<import src="$(WML_SRC_FILENAME)">
</box>
</protect>
Explanations stand on wml_p8_htmlstrip(1) : sharp/comment-lines
are removed. In this particular case, i think the right answer should be
<fsview src="$(WML_SRC_FILENAME)">
<box>
<import src="$(WML_SRC_FILENAME)" format=verbatim>
</box>
Indeed, when the attribute format=verbatim is set, one expects that the
file goes unchanged on the output. And i see no reason why files
included via the <fsview> tag are expanded. In fact, i don't understand
what this tag is intended for. Ralf, do you remember what you had in
mind?
To fix these problems, i see 2 solutions:
* Insert <protect pass=4-9>...</protect> in the wml_fmt_verbatim Perl
subroutine in wml::fmt::verbatim (internally called when the attribute
format=verbatim is set).
* Don't suppress sharp/comment-lines inside <pre>...</pre>
The latter is more attractive, but the former is more general. You could
then import files containing slice commands, for instance.
If there is no objection, i'll implement the former. If you want, try
the patch below. Apply either to wml_include/fmt/verbatim.src or
....prefix/lib/wml/include/fmt/verbatim.wml
--
Denis Barbier
WML Maintainer
--- verbatim.src Tue Jun 8 00:25:08 1999
+++ verbatim.src Wed Jul 7 23:59:02 1999
@@ -23,7 +23,7 @@
$buf =~ s|>|>|sg;
$buf =~ s|\n+\s*$||s;
- return "<pre>\n$buf</pre>";
+ return "<protect pass=4-9><pre>\n$buf</pre></protect>";
}
:>
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com