diff --git a/basis/farkup/farkup-tests.factor b/basis/farkup/farkup-tests.factor index 7cae523efb..abee7194a2 100644 --- a/basis/farkup/farkup-tests.factor +++ b/basis/farkup/farkup-tests.factor @@ -182,7 +182,7 @@ link-no-follow? off [ "
foo|bar |
[abc]
" ] [ "[abc]" convert-farkup ] unit-test +[ "[abc]
" ] [ "[abc]" convert-farkup ] unit-test : random-markup ( -- string ) 10 [ diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index 41c6c4aa00..c400457c0b 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -121,7 +121,7 @@ DEFER: (parse-paragraph) ] if ] if ; -: take-until ( state delimiter -- string/f state' ) +: take-until ( state delimiter -- string state'/f ) V{ } clone (take-until) ; : count= ( string -- n ) @@ -186,11 +186,12 @@ DEFER: (parse-paragraph) : parse-code ( state -- state' item ) dup 1 look CHAR: [ = - [ unclip-slice make-paragraph ] [ - "{" take-until - [ rest ] dip - "}]" take-until - [ code boa ] dip swap + [ take-line make-paragraph ] [ + dup "{" take-until [ + [ nip rest ] dip + "}]" take-until + [ code boa ] dip swap + ] [ drop take-line make-paragraph ] if* ] if ; : parse-item ( state -- state' item )