Changeset 379
- Timestamp:
- 06/23/08 19:11:00 (2 months ago)
- Files:
-
- trunk/src/ingy/WikiText-Socialtext/Changes (modified) (1 diff)
- trunk/src/ingy/WikiText-Socialtext/lib/WikiText/Socialtext.pm (modified) (2 diffs)
- trunk/src/ingy/WikiText-Socialtext/lib/WikiText/Socialtext/Parser.pm (modified) (5 diffs)
- trunk/src/ingy/WikiText-Socialtext/t/parser.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ingy/WikiText-Socialtext/Changes
r289 r379 1 --- 2 version: 0.11 3 date: Mon Jun 23 19:05:16 PDT 2008 4 changes: 5 - Lines that don't match anything else are parsed as a plain text paragraph. 6 --- 7 version: 0.10 8 date: Wed Jun 11 14:38:45 PDT 2008 9 changes: 10 - support '^Foo' 11 - support '- foo' 12 - support '+ foo' 1 13 --- 2 14 version: 0.09 trunk/src/ingy/WikiText-Socialtext/lib/WikiText/Socialtext.pm
r289 r379 3 3 4 4 use 5.006.001; 5 our $VERSION = '0. 09';5 our $VERSION = '0.11'; 6 6 7 7 1; … … 19 19 =head1 DESCRIPTION 20 20 21 This module can convert Socialtext markup to HTML. `21 This module can convert Socialtext markup to HTML. 22 22 23 23 =head1 AUTHOR trunk/src/ingy/WikiText-Socialtext/lib/WikiText/Socialtext/Parser.pm
r332 r379 29 29 ]; 30 30 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 ) 32 40 ]; 33 41 … … 72 80 }, 73 81 82 else => { 83 match => qr/^(.*)\n/, 84 phrases => [], 85 filter => sub { 86 my $node = shift; 87 $node->{type} = 'p'; 88 }, 89 }, 90 74 91 pre => { 75 92 match => qr/^(?m:^\.pre\ *\n)((?:.*\n)*?)(?m:^\.pre\ *\n)(?:\s*\n)?/, … … 99 116 100 117 hx => { 101 match => qr/^(\^+) +(.*?)(\s+=+)?\s*?\n+/,118 match => qr/^(\^+) *(.*?)(\s+=+)?\s*?\n+/, 102 119 filter => sub { 103 120 my $node = shift; … … 108 125 109 126 ul => { 110 match => re_list(' \*'),127 match => re_list('[\*\-\+]'), 111 128 blocks => [qw(ul ol subl li)], 112 filter => sub { s/^[\*\ #] *//mg },129 filter => sub { s/^[\*\-\+\#] *//mg }, 113 130 }, 114 131 … … 302 319 # Capture everything in $1 303 320 ^$bullet+\ .*\n # Line starting with one or more bullet 304 (?:[\*\ #]+\ .*\n)* # Lines starting with '*' or '#'321 (?:[\*\-\+\#]+\ .*\n)* # Lines starting with '*' or '#' 305 322 )(?:\s*\n)?/x, # Eat trailing lines 306 323 } trunk/src/ingy/WikiText-Socialtext/t/parser.t
r289 r379 2 2 use t::TestWikiText; 3 3 4 plan tests => 19;4 plan tests => 22; 5 5 6 6 #no_diff; … … 14 14 15 15 __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 36 blah blah 37 --- wikibyte 38 +h2 39 Welcome to the Workspace 40 -h2 41 +p 42 blah blah 43 -p 44 16 45 === Multiline Paragraphs 17 46 … … 388 417 -b 389 418 -p 419 420 === Bad Markup 421 --- wikitext 422 | *foo* | bar 423 424 baz 425 --- wikibyte 426 +p 427 | *foo* | bar 428 -p 429 +p 430 baz 431 -p 432
