commit d9ed44cc860a5c7dc7cf162d2fc9c8b07a6a773e parent ffb9e98152c91aecfe507b7a38a43977c79446da Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu> Date: Sun, 13 Mar 2016 15:50:03 -0400 do not drop initial indent of Verb blocks Diffstat:
| M | doc/txt/txt.ml | | | 10 | ++++++---- |
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/doc/txt/txt.ml b/doc/txt/txt.ml @@ -103,17 +103,19 @@ let isolist l = endnum l <> 0 let isulist l = endbul l <> 0 let getverb lines idnt = + let rec skip = function + | s :: l when String.trim s = "" -> skip l + | l -> l in let rec f ls = match top lines with | Some (n, i, l) when i >= idnt - || dedent l (i+1) = "" -> + || String.trim l = "" -> pop lines; f (dedent l idnt :: ls) | _ -> - List.rev ls |> - String.concat "\n" |> - String.trim in + skip ls |> List.rev |> + String.concat "\n" in f [] let getpar lines idnt =