handle farkup tables better
parent
91aa69dda6
commit
3d92c0e1bd
|
@ -36,17 +36,17 @@ IN: farkup.tests
|
||||||
[ "<p>|a</p>" ]
|
[ "<p>|a</p>" ]
|
||||||
[ "|a" convert-farkup ] unit-test
|
[ "|a" convert-farkup ] unit-test
|
||||||
|
|
||||||
[ "<p>|a|</p>" ]
|
[ "<table><tr><td>a</td></tr></table>" ]
|
||||||
[ "|a|" convert-farkup ] unit-test
|
[ "|a|" convert-farkup ] unit-test
|
||||||
|
|
||||||
[ "<table><tr><td>a</td><td>b</td></tr></table>" ]
|
[ "<table><tr><td>a</td><td>b</td></tr></table>" ]
|
||||||
[ "a|b" convert-farkup ] unit-test
|
[ "|a|b|" convert-farkup ] unit-test
|
||||||
|
|
||||||
[ "<table><tr><td>a</td><td>b</td></tr></table>\n<table><tr><td>c</td><td>d</td></tr></table>" ]
|
[ "<table><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>" ]
|
||||||
[ "a|b\nc|d" convert-farkup ] unit-test
|
[ "|a|b|\n|c|d|" convert-farkup ] unit-test
|
||||||
|
|
||||||
[ "<table><tr><td>a</td><td>b</td></tr></table>\n<table><tr><td>c</td><td>d</td></tr></table>\n" ]
|
[ "<table><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>" ]
|
||||||
[ "a|b\nc|d\n" convert-farkup ] unit-test
|
[ "|a|b|\n|c|d|\n" convert-farkup ] unit-test
|
||||||
|
|
||||||
[ "<p><strong>foo</strong>\n</p><h1>aheading</h1>\n<p>adfasd</p>" ]
|
[ "<p><strong>foo</strong>\n</p><h1>aheading</h1>\n<p>adfasd</p>" ]
|
||||||
[ "*foo*\n=aheading=\nadfasd" convert-farkup ] unit-test
|
[ "*foo*\n=aheading=\nadfasd" convert-farkup ] unit-test
|
||||||
|
|
|
@ -129,12 +129,14 @@ MEMO: table-column ( -- parser )
|
||||||
text [ "td" surround-with-foo ] action ;
|
text [ "td" surround-with-foo ] action ;
|
||||||
|
|
||||||
MEMO: table-row ( -- parser )
|
MEMO: table-row ( -- parser )
|
||||||
[
|
"|" token hide
|
||||||
table-column "|" token hide list-of-many ,
|
table-column "|" token hide list-of
|
||||||
] seq* [ "tr" surround-with-foo ] action ;
|
"|" token hide nl hide optional 4seq
|
||||||
|
[ "tr" surround-with-foo ] action ;
|
||||||
|
|
||||||
MEMO: table ( -- parser )
|
MEMO: table ( -- parser )
|
||||||
table-row repeat1 [ "table" surround-with-foo ] action ;
|
table-row repeat1
|
||||||
|
[ "table" surround-with-foo ] action ;
|
||||||
|
|
||||||
MEMO: code ( -- parser )
|
MEMO: code ( -- parser )
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue