Changeset 59 in text-formbuilder


Ignore:
Timestamp:
01/31/05 14:58:23 (19 years ago)
Author:
peichman
Message:

added a class="fieldgroup" attr to field group spans
added a brace_block to the parser, to parse [...] with nested [...]'s

Location:
trunk/lib/Text
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Text/FormBuilder.pm

    r57 r59  
    530530                $OUT .= qq[</th>\n]; 
    531531                 
    532                 $OUT .= qq[    <td>]; 
     532                $OUT .= qq[    <td><span class="fieldgroup">]; 
    533533                $OUT .= join(' ', map { qq[<small class="sublabel">$$_{label}</small> $$_{field} $$_{comment}] } @group_fields); 
    534534                $OUT .= " $msg_invalid" if $$_{invalid}; 
    535  
    536                 $OUT .= qq[    </td>\n]; 
     535                 
     536                $OUT .= qq[    </span></td>\n]; 
    537537                $OUT .= qq[  </tr>\n]; 
    538538            }    
  • trunk/lib/Text/FormBuilder/grammar

    r57 r59  
    234234value: identifier 
    235235 
    236 display_text: '[' /[^\]]+/i ']'    { $item[2] } 
     236display_text: brace_block 
     237    { (my $text = $item[1]) =~ s/^\[\s*|\s*\]$//g; $text } 
     238 
     239# square brace delimited block, that can contain properly 
     240# nested square braces, along with any other characters 
     241# return with the '[...]' so that nested blocks get the 
     242# braces treated as literals 
     243brace_block: '[' <skip:''> brace_block_content(s) ']' 
     244    { 
     245        '[' . join('', @{ $item[3] }) . ']'; 
     246    } 
     247brace_block_content: /[^\[\]]+?/ | brace_block 
     248 
    237249 
    238250validate: '//' (optional_pattern | required_pattern)    { $item[2] } 
Note: See TracChangeset for help on using the changeset viewer.