From 438accb312c9eadcf25818d4193d4554f4758ffa Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Mon, 6 Apr 2015 17:58:00 +0200 Subject: [PATCH] texi2txt: fix support embedded item lists to allow nested lists There are some cases where it can be useful to embed a list of item into another list; the script was almost ready to handle this case, this patch brings the missing stuff to get it to work properly. Signed-off-by: Christophe CURIS --- script/generate-txt-from-texi.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/generate-txt-from-texi.sh b/script/generate-txt-from-texi.sh index 59821f1f..8c518559 100755 --- a/script/generate-txt-from-texi.sh +++ b/script/generate-txt-from-texi.sh @@ -239,6 +239,7 @@ function par_mode_push(mode, local_i) { par_mode_save_length[par_mode_count] = line_length; par_mode_save_prefix[par_mode_count] = line_prefix; par_mode_save_justify[par_mode_count] = par_justify; + par_mode_save_itemmark[par_mode_count] = item_list_mark; par_mode = mode; # Check for quality of output @@ -256,6 +257,7 @@ function par_mode_pop(mode, local_i) { line_length = par_mode_save_length[par_mode_count]; line_prefix = par_mode_save_prefix[par_mode_count]; par_justify = par_mode_save_justify[par_mode_count]; + item_list_mark = par_mode_save_itemmark[par_mode_count]; par_mode_count--; } @@ -452,7 +454,12 @@ function start_item_list(mark) { list_is_first_item = 1; list_item_wants_sepline = 0; par_indent = 1; - line_prefix = " "; + if (line_prefix == "") { + # First level of enumeration get one mode indentation space + line_prefix = " "; + } else { + line_prefix = line_prefix " "; + } if (mark == "") { item_list_mark = "*"; } else {