On Feb 21, 7:59 am, "Edward K. Ream" <[email protected]> wrote:
> It appears that the indentation of the second @doc part is causing the
> rst3 code to include the second doc part in the code part. Removing
> the indentation generates the expected rst output and the
> corresponding .html file.
>
> I'll look for a simple fix, but I'll include any fix in Leo 4.7 only
> if I am convinced that the fix can have no side effects.
Ok. I have simple fixes, but none are safe enough to include in Leo
4.7 final-there is no way of knowing what all the side effects might
be.
In the meantime, removing the leading whitespace from the first line
of the second @doc part should be a good enough workaround.
There are three possible fixes, all similar:
1. In getDocPart (in leoRst.py), change::
result.append(s)
to:
result.append(s.lstrip())
There are two such lines in getDocPart. Probably both should be
changed.
2. The same fix, conditional on a new 'stripLines' keyword arg. Like
this:
if stripLines:
result.append(s.lstrip())
else:
result.append(s)
Again, this change affects two lines in getDocPart.
The idea is that handleCodeMode would be the only method to set the
stripLines arg:
n, lines2 = self.getDocPart(lines,n)
3. A change to handleCodeMode. After the line:
n, lines2 = self.getDocPart(lines,n)
add the line:
lines2 = [z.lstrip() for z in lines2]
As I write this, I am thinking that change #3 is the simplest change,
with the fewest side effects.
We can test any one of these solutions starting early in the Leo 4.8
release cycle, but none is safe enough to include in Leo 4.7 final.
If you would, please test fix #3 and report your results. Thanks.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.