[Jifty-commit] r495 - in wifty/trunk: etc lib/Wifty/Model

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jan 11 13:56:16 EST 2006


Author: alexmv
Date: Wed Jan 11 13:56:16 2006
New Revision: 495

Modified:
   wifty/trunk/   (props changed)
   wifty/trunk/etc/config.yml
   wifty/trunk/lib/Wifty/Model/Page.pm

Log:
 r8625 at zoq-fot-pik:  chmrr | 2006-01-11 13:55:41 -0500
  * Site-specific stuff should go in the siteconfig
  * Avoid double-escaping <'s by doing markdown then scrub; loosen
    scrubbing to allow all of markdown through


Modified: wifty/trunk/etc/config.yml
==============================================================================
--- wifty/trunk/etc/config.yml	(original)
+++ wifty/trunk/etc/config.yml	Wed Jan 11 13:56:16 2006
@@ -2,9 +2,6 @@
   AdminMode: 0
   ApplicationName: Wifty
 
-  Web:
-    Port: 80
-    BaseURL: http://jifty.org
   Database:
     Driver: SQLite
     Host: localhost
@@ -16,5 +13,3 @@
 #  MailerArgs:
 #    - %log/mail.log%
   SiteConfig: etc/site_config.yml
-application: 
-  MaxWurbles: 9

Modified: wifty/trunk/lib/Wifty/Model/Page.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Model/Page.pm	(original)
+++ wifty/trunk/lib/Wifty/Model/Page.pm	Wed Jan 11 13:56:16 2006
@@ -40,7 +40,7 @@
 
 sub wiki_content {
     my $self     = shift;
-    my $content  = shift ||$self->content();
+    my $content  = shift || $self->content() || '';
     my $scrubber = HTML::Scrubber->new();
 
     $scrubber->default(
@@ -48,7 +48,7 @@
         {   '*'   => 0,
             id    => 1,
             class => 1,
-            href  => qr{^(?:http:|ftp:|https:|/)}i,
+            href  => qr{^(?:(?:\w+$)|http:|ftp:|https:|/)}i,
 
             # Match http, ftp and relative urls
             face   => 1,
@@ -59,9 +59,12 @@
 
     $scrubber->deny(qw[*]);
     $scrubber->allow(
-        qw[A B U P BR I HR BR SMALL EM FONT SPAN DIV UL OL LI DL DT DD]);
+        qw[H1 H2 H3 H4 H5 A STRONG EM CODE PRE B U P BR I HR BR SPAN DIV UL OL LI DL DT DD]);
     $scrubber->comment(0);
-    return ( markdown( $scrubber->scrub( $content || '') ) );
+
+    $content = markdown( $content );
+    $content = $scrubber->scrub( $content );
+    return ( $content );
 
 }
 


More information about the Jifty-commit mailing list