Roxen.git/
server/
modules/
tags/
rxmltags.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2000-04-14
2000-04-14 22:12:27 by Per Hedbor <ph@opera.com>
a7a5436aa222eb6fb5ca6a975c1873cf8047a4f7 (
50
lines) (+
32
/-
18
)
[
Show
|
Annotate
]
Branch:
5.2
Imported fix from 2.0
Rev: server/modules/tags/rxmltags.pike:1.113
7:
#define _rettext id->misc->defines[" _rettext"] #define _ok id->misc->defines[" _ok"]
-
constant cvs_version="$Id: rxmltags.pike,v 1.
112
2000/04/
12
14:
16
:
35
nilsson
Exp $";
+
constant cvs_version="$Id: rxmltags.pike,v 1.
113
2000/04/
14
22
:
12
:
27
per
Exp $";
constant thread_safe=1; constant language = roxen->language;
1041:
return Roxen.make_tag(m->name, args); }
-
string
simpletag_doc(string
tag,
mapping
m,
string s)
-
{
-
if(!m[
"
quote
"
])
-
if(m["pre"])
{
-
m
_
delete
(
m,"pre"
)
;
-
return
"\n"+Roxen
.
make
_
container("pre",m,
-
replace(s, ({"{","}","& "}),({"<
;
",">","& "})))+"\n";
+
class
TagDoc
{
+
inherit
RXML.Tag;
+
constant name=
"
doc
"
;
+
RXML.Type
content_type
=
RXML.t_same;
+
+
class Frame
{
+
inherit
RXML.Frame;
+
+
array do
_
enter
(
RequestID id
)
{
+
if(args->quote)
content_type = RXML
.
t
_
same;
+
return
0
;
}
-
else
-
return
replace
(
s,
({
"
{
",
"}",
"&
"
}),
({
"<",
">
;
", "& " }));
-
else
-
if(
m["pre"]
) {
-
m_delete(m,"pre");
-
m_delete(
m
,"quote");
-
return
"\n"+Roxen.make_container("pre",m,
-
replace
(
s, (
{"<",">",
"&
"
}),({"
&
lt;
"
,">","&
"
})
))+"\n"
;
+
+
array
do_
return(
RequestID
id)
{
+
array
from
;
+
if(
args->quote
) {
+
m_delete(
args
,
"quote");
+
from=
(
{
"<",
">", "&" });
} else
-
return
replace(s,
({ "
<
", "
>
", "&
" }), ({ "<", ">", "&
"
}));
+
from=
({ "
{
", "
}
", "&" })
;
+
+
result=replace(content
,
from,
({ "<", ">", "&"})
);
+
+
if(args->pre) {
+
m_delete(args, "pre");
+
result="\n"+Roxen.make_container("pre", args, result)+"\n";
}
-
+
return 0;
+
}
+
}
+
}
+
string simpletag_autoformat(string tag, mapping m, string s, RequestID id) { s-="\r";