diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-13 15:50:03 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-13 15:50:03 -0400 |
commit | d9ed44cc860a5c7dc7cf162d2fc9c8b07a6a773e (patch) | |
tree | 8072a800c298d334a9617f489016f6a810608596 /doc/txt | |
parent | ffb9e98152c91aecfe507b7a38a43977c79446da (diff) | |
download | roux-d9ed44cc860a5c7dc7cf162d2fc9c8b07a6a773e.tar.gz |
do not drop initial indent of Verb blocks
Diffstat (limited to 'doc/txt')
-rw-r--r-- | doc/txt/txt.ml | 10 |
1 files changed, 6 insertions, 4 deletions
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 = |