From d9ed44cc860a5c7dc7cf162d2fc9c8b07a6a773e Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 13 Mar 2016 15:50:03 -0400 Subject: do not drop initial indent of Verb blocks --- doc/txt/txt.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/txt/txt.ml b/doc/txt/txt.ml index 1b467ef..9f4f082 100644 --- 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 = -- cgit 1.4.1