Hmm. What about making DocPara strip leading and trailing spaces
*except* for the first leading space in a paragraph?
This seems reasonable. This will be implemented as follows:
* DocPara will have a new property 'indent' which will store the
indentation of the first line of the paragraph.
* The previous paragraph's indent value will be stored as the 'margin'
in the caller (DocField).
* 'margin' will be sent while creating DocPara for the next paragraph.
* DocPara will compare this value (previous para's indent) with the
current indentation. If indent > margin + 2, it will add 4 spaces
to the first line (see below for why I'm adding 4 spaces).
We can enforce
the assumption that the indentation of a paragraph is determined by
the number of spaces starting the first line. If we do that, the
markdown parser sees the correct indentation. Am I missing something?
Continuing paragraphs in lists require at least 4-space indentation.
I found an example in '
ftdriver.h'. Changing the '1)' to '1.' and indenting the
2nd paragraph still won't work directly with markdown because there will
be only 3 spaces.
Therefore for convenience, I'm keeping the required indentation at 3
spaces, and adding 4 wherever there are 3 or more.
Also, the 3 space minimum indent is because URLs are indented with
2 spaces currently, and I don't want to touch them in the output.
Does this seem to be OK?