string, or the absence of an indent. We will use a string to
represent a presence, and a `NULL` to represent the absence.
-While looking at code we don't think about paragraphs are all - just
+While looking at code we don't think about paragraphs at all - just
look for a line that starts with the right thing.
Every line that is still code then needs to be examined to see if it
is a section reference.
code (which is a tab or 4 spaces). We use a separate function `count_spaces`
for that.
+If there are completely blank linkes (no indent) at the end of the found code,
+these should be considered to be spacing between the code and the next section,
+and so no included in the code. When a marker is used to explicitly mark the
+end of the code, we don't need to check for these blank lines.
+
#### internal functions
static int count_space(char *sol, char *p)
struct text txt;
txt.txt = start;
txt.len = pos - start;
+ /* strip trailing blank lines */
+ while (!marker && txt.len > 2 &&
+ start[txt.len-1] == '\n' &&
+ start[txt.len-2] == '\n')
+ txt.len -= 1;
+
code_add_text(sect, txt, start_line,
marker == NULL);
}