/[Frey]/trunk/lib/Frey/HTML.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/HTML.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 224 by dpavlin, Fri Aug 15 23:49:11 2008 UTC revision 225 by dpavlin, Sat Nov 1 00:59:02 2008 UTC
# Line 18  sub xhtml { Line 18  sub xhtml {
18          $html->parse( $self->html );          $html->parse( $self->html );
19          $html->eof;          $html->eof;
20    
21          my $result = _parse( $html->guts );          my $result = $self->_parse( $html->guts );
22          $html->delete;          $html->delete;
23    
24          return $result;          return $result;
25  }  }
26    
27  sub _parse {  sub _parse {
28            my $self = shift;
29          foreach my $element ( @_ ) {          foreach my $element ( @_ ) {
30                  if ( blessed $element && $element->isa('HTML::Element') ) {                  if ( blessed $element && $element->isa('HTML::Element') ) {
31                          my $tag = $element->tag;                          my $tag = $element->tag;
# Line 34  sub _parse { Line 35  sub _parse {
35                  } else {                  } else {
36                          # plain text                          # plain text
37                          warn dump( $element );                          warn dump( $element );
38                          return _escape( $element );                          return $self->html_escape( $element );
39                  }                  }
40          }          }
41  }  }
42    
 sub _escape {  
         my $html = shift;  
         $html =~ s/</&lt;/;  
         $html =~ s/>/&gt;/;  
         return $html;  
 }  
   
43  1;  1;

Legend:
Removed from v.224  
changed lines
  Added in v.225

  ViewVC Help
Powered by ViewVC 1.1.26