Patch and test to allow component calls
Alex Robinson <[email protected]>
| Newsgroups | gmane.comp.web.mason.devel |
|---|---|
| Message-ID | <a06110431bd70dddf1f7e@[192.168.1.201]> |
Given the imminentish release of 1.3 and the inclusion of Apache 2
support and other nice bugfixes, is there any chance that Lexer.pm
can be finally tweaked to allow component-with-content end tags to
contain additional text, eg. </& foo>? (as discussed several times
before)
--- Lexer.pm current
+++ Lexer.pm proposed
@@ -489,11 +489,11
>>>
sub match_comp_content_call_end
{
my $self = shift;
- if ( $self->{current}{comp_source} =~ m,\G</&>,gc )
+ if ( $self->{current}{comp_source} =~ m,\G</&[^>]*>,gc )
{
$self->{current}{compiler}->component_content_call_end;
return 1;
}
}
<<<
--- t/01-syntax.t current
+++ t/01-syntax.t proposed
@@ -318,0 +318,19
>>>
#------------------------------------------------------------
+
+ $group->add_test( name => 'text_in_closing_comp_tag',
+ description => 'tests that comp call with
content can have arbitrary text in its closing tag',
+ component => <<'EOF',
+<&| .show_content,
+ foo => 1,
+ &>\
+This is the content\
+</& .show_content>
+<%def .show_content>\
+<% $m->content %>\
+</%def>
+EOF
+ expect => <<'EOF',
+This is the content
+EOF
+ );
+
+
<<<
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php