From 0db192e179c0a9792b366f07ce9a51563ffc9986 Mon Sep 17 00:00:00 2001
From: Rene Rivera ;
+ }
+ local pre = ;
+ while $(description)
+ {
+ local paragraph = ;
+ while $(description) && $(description[1]) = "" { description = $(description[2-]) ; }
+ if $(pre)
{
- local paragraph = ;
- while $(description) && $(description[1]) = "" { description = $(description[2-]) ; }
- if $(pre)
+ pre = ;
+ while $(description) && ( $(description[1]) = "" || [ MATCH "^([ ])" : $(description[1]) ] )
+ { paragraph += $(description[1]) ; description = $(description[2-]) ; }
+ if $(output-type) = plain
{
- pre = ;
- while $(description) && ( $(description[1]) = "" || [ MATCH "^([ ])" : $(description[1]) ] )
- { paragraph += $(description[1]) ; description = $(description[2-]) ; }
lines $(paragraph) : " " " " ;
}
- else
+ else if $(output-type) = html
{
- while $(description) && $(description[1]) != ""
- { paragraph += $(description[1]) ; description = $(description[2-]) ; }
- if $(paragraph[1]) = :: && ! $(paragraph[2])
- {
- pre = yes ;
- }
- if $(paragraph[1]) = ::
+ text $(name)
;
+ lines $(paragraph) ;
+ text
;
+ }
+ }
+ else
+ {
+ while $(description) && $(description[1]) != ""
+ { paragraph += $(description[1]) ; description = $(description[2-]) ; }
+ if $(paragraph[1]) = :: && ! $(paragraph[2])
+ {
+ pre = yes ;
+ }
+ if $(paragraph[1]) = ::
+ {
+ if $(output-type) = plain
{
lines $(paragraph[2-]) : " " " " ;
lines ;
}
- else
+ else if $(output-type) = html
{
- local p = [ MATCH "(.*)(::)$" : $(paragraph[-1]) ] ;
- local pws = [ MATCH "([ ]*)$" : $(p[1]) ] ;
- p = [ MATCH "(.*)($(pws))($(p[2]))$" : $(paragraph[-1]) ] ;
- if $(p[3]) = ::
+ text ;
+ lines $(paragraph[2-]) ;
+ text
;
+ }
+ }
+ else
+ {
+ local p = [ MATCH "(.*)(::)$" : $(paragraph[-1]) ] ;
+ local pws = [ MATCH "([ ]*)$" : $(p[1]) ] ;
+ p = [ MATCH "(.*)($(pws))($(p[2]))$" : $(paragraph[-1]) ] ;
+ if $(p[3]) = ::
+ {
+ pre = yes ;
+ if ! $(p[2]) || $(p[2]) = "" { paragraph = $(paragraph[1--2]) $(p[1]): ; }
+ else { paragraph = $(paragraph[1--2]) $(p[1]) ; }
+ if $(output-type) = plain
{
- pre = yes ;
- if ! $(p[2]) || $(p[2]) = "" { paragraph = $(paragraph[1--2]) $(p[1]): ; }
- else { paragraph = $(paragraph[1--2]) $(p[1]) ; }
lines [ split-at-words " " $(paragraph) ] : " " " " ;
lines ;
}
- else
+ else if $(output-type) = html
+ {
+ text
[ escape-html $(paragraph) ] ; + } + } + else + { + if $(output-type) = plain { lines [ split-at-words " " $(paragraph) ] : " " " " ; lines ; } + else if $(output-type) = html + { + text
[ escape-html $(paragraph) ] ; + } } } } } + if $(output-type) = html + { + text
; + } } # Generate the start of a list of items. The type of output can be @@ -107,6 +167,10 @@ rule list-start ( ) if $(output-type) = plain { } + else if $(output-type) = html + { + text