extract ++new-container logic
=/ bal lub
::
:: if within section
- ?^ bal
+ ?~ bal (new-container pic)
::
:: detect bad block structure
?. ?- p.cur
::
- :: only one line in a heading/ruler
- ?($rule $head) |
+ :: can't(/directly) contain text
+ ?($rule $lord $list) ~|(bad-leaf-container+p.cur !!)
+ ::
+ :: only one line in a header
+ $head |
::
:: literals need to end with a blank line
- ?($code $poem $expr)
- (gte col.pic col)
+ ?($code $poem $expr) (gte col.pic col)
::
:: text flows must continue aligned
- ?($down $list $lime $lord $bloc)
- &(=(%text sty.pic) =(col.pic col))
+ ?($down $list $lime $lord $bloc) =(col.pic col)
==
- ~& bad-block-structure+[col pic cur]
..$(err `[p.naz col.pic])
- ::?: sth sth-else ::TODO
::
:: accept line and continue
=^ nap ..$ snap
line(lub bal(q.u [nap q.u.bal]))
::
+ ++ new-container
+ |= pic/trig
+ ::
:: if column has retreated, adjust stack
- =. ..$ ?. (lth col.pic col) ..$ (back col.pic)
+ =. +>.$ ?. (lth col.pic col) +>.$ (back col.pic)
::
:: dif: columns advanced
:: erp: error position
=/ erp [p.naz col.pic]
::
:: nap: take first line
- =^ nap ..$ snap
+ =^ nap +>.$ snap
::
:: execute appropriate paragraph form
=< line:abet:apex
::
++ apse ^+ . :: by prefix style
?- sty.pic
- $fini !! :: terminator
+ ?($fini $done) !! :: terminator
$rule (push %rule) :: horizontal ruler
$head (push %head) :: heading
$bloc (entr %bloc) :: blockquote line
::
:: only in lists, fold
?. ?=(?($list $lord) p.cur) .
- .($ fold)
+ .(^$ fold)
--
--
::
;~(pfix gay apex:(sail &))
::
++ whit :: whitespace
- (cold ' ' (plus ;~(pose (just ' ') (just `@`10))))
+ (cold ' ' (plus ;~(pose (just ' ') line)))
::
+ ++ line (just '\0a') ::TODO lookahead
++ head :: parse heading
%+ cook
|= a/manx:dynamic ^- marl:dynamic
