Changeset 379

Show
Ignore:
Timestamp:
06/23/08 19:11:00 (2 months ago)
Author:
ingy
Message:
0.11
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/ingy/WikiText-Socialtext/Changes

    r289 r379  
     1--- 
     2version: 0.11 
     3date:    Mon Jun 23 19:05:16 PDT 2008 
     4changes: 
     5- Lines that don't match anything else are parsed as a plain text paragraph. 
     6--- 
     7version: 0.10 
     8date:    Wed Jun 11 14:38:45 PDT 2008 
     9changes: 
     10- support '^Foo' 
     11- support '- foo' 
     12- support '+ foo' 
    113--- 
    214version: 0.09 
  • trunk/src/ingy/WikiText-Socialtext/lib/WikiText/Socialtext.pm

    r289 r379  
    33 
    44use 5.006.001; 
    5 our $VERSION = '0.09'; 
     5our $VERSION = '0.11'; 
    66 
    771; 
     
    1919=head1 DESCRIPTION 
    2020 
    21 This module can convert Socialtext markup to HTML.` 
     21This module can convert Socialtext markup to HTML. 
    2222 
    2323=head1 AUTHOR 
  • trunk/src/ingy/WikiText-Socialtext/lib/WikiText/Socialtext/Parser.pm

    r332 r379  
    2929    ]; 
    3030    my $all_blocks = [ 
    31         qw(pre wafl_block hr hx waflparagraph ul ol blockquote table p empty) 
     31        qw( 
     32            pre wafl_block 
     33            hr hx 
     34            waflparagraph 
     35            ul ol 
     36            blockquote table 
     37            p empty 
     38            else 
     39        ) 
    3240    ]; 
    3341 
     
    7280        }, 
    7381 
     82        else => { 
     83            match => qr/^(.*)\n/, 
     84            phrases => [], 
     85            filter => sub { 
     86                my $node = shift; 
     87                $node->{type} = 'p'; 
     88            }, 
     89        }, 
     90 
    7491        pre => { 
    7592            match => qr/^(?m:^\.pre\ *\n)((?:.*\n)*?)(?m:^\.pre\ *\n)(?:\s*\n)?/, 
     
    99116 
    100117        hx => { 
    101             match => qr/^(\^+) +(.*?)(\s+=+)?\s*?\n+/, 
     118            match => qr/^(\^+) *(.*?)(\s+=+)?\s*?\n+/, 
    102119            filter => sub { 
    103120                my $node = shift; 
     
    108125 
    109126        ul => { 
    110             match => re_list('\*'), 
     127            match => re_list('[\*\-\+]'), 
    111128            blocks => [qw(ul ol subl li)], 
    112             filter => sub { s/^[\*\#] *//mg }, 
     129            filter => sub { s/^[\*\-\+\#] *//mg }, 
    113130        },  
    114131 
     
    302319                            # Capture everything in $1 
    303320        ^$bullet+\ .*\n     # Line starting with one or more bullet 
    304         (?:[\*\#]+\ .*\n)*  # Lines starting with '*' or '#' 
     321        (?:[\*\-\+\#]+\ .*\n)*  # Lines starting with '*' or '#' 
    305322    )(?:\s*\n)?/x,          # Eat trailing lines 
    306323} 
  • trunk/src/ingy/WikiText-Socialtext/t/parser.t

    r289 r379  
    22use t::TestWikiText; 
    33 
    4 plan tests => 19
     4plan tests => 22
    55 
    66#no_diff; 
     
    1414 
    1515__DATA__ 
     16=== Old lists 
     17 
     18--- wikitext 
     19- one 
     20- two 
     21--- wikibyte 
     22+ul 
     23+li 
     24 one 
     25-li 
     26+li 
     27 two 
     28-li 
     29-ul 
     30 
     31=== Headers Without Spaces 
     32 
     33--- wikitext 
     34^^Welcome to the Workspace 
     35 
     36blah blah 
     37--- wikibyte 
     38+h2 
     39 Welcome to the Workspace 
     40-h2 
     41+p 
     42 blah blah 
     43-p 
     44 
    1645=== Multiline Paragraphs 
    1746 
     
    388417-b 
    389418-p 
     419 
     420=== Bad Markup 
     421--- wikitext 
     422| *foo* | bar 
     423 
     424baz 
     425--- wikibyte 
     426+p 
     427 | *foo* | bar 
     428-p 
     429+p 
     430 baz 
     431-p 
     432