XML::Tags->import($opts, @HTML_TAGS, @rest);
}
+sub to_html_string { XML::Tags::to_xml_string(@_) }
+
1;
$IN_SCOPE = 1;
}
-sub sanitize {
+sub to_xml_string {
map { # string == text -> HTML, scalarref == raw HTML, other == passthrough
ref($_)
? (ref $_ eq 'SCALAR' ? $$_ : $_)
sub _set_glob {
# stupid insanity. delete anything already there so we disassociated
- # the *CORE::GLOBAL::glob typeglob. Then the compilation of the eval
+ # the *CORE::GLOBAL::glob typeglob. Then the string reference call
# revivifies it - i.e. creates us a new glob, which we get a reference
# to, which we can then assign to.
- # doing it without the eval doesn't - it binds to the version in scope
+ # doing it without the quotes doesn't - it binds to the version in scope
# at compile time, which means after a delete you get a nice warm segv.
delete ${CORE::GLOBAL::}{glob};
- *{eval '\*CORE::GLOBAL::glob'} = $_[0];
+ no strict 'refs';
+ *{'CORE::GLOBAL::glob'} = $_[0];
}
sub _export_tags_into {
}
is(
- join(', ', XML::Tags::sanitize Foo::foo()),
+ join(', ', XML::Tags::to_xml_string Foo::foo()),
'<one>, <two>, <three>',
'open tags ok'
);
ok(!eval { Foo::bar(); 1 }, 'Death on use of unimported tag');
is(
- join(', ', XML::Tags::sanitize Foo::baz()),
+ join(', ', XML::Tags::to_xml_string Foo::baz()),
'</bar>',
'close tag ok'
);
is(
- join('', XML::Tags::sanitize Foo::quux),
+ join('', HTML::Tags::to_html_string Foo::quux),
'<html><body id="spoon">YAY</body></html>',
'HTML tags ok'
);