Patch attached with current version. I noted in a comment that we should probably replace some of format_paragraph with textwrap.wrap.
The find_paragraph test works fine with the current text mock. I split one test method and will probably do more.
It could be considered a bug that find_paragraph included the hidden terminal \n when it finds the final line of the text and that line has no \n. Since that is a fairly unrealistic test case, we might do better to add \n on all test snippets. Certainly, adding \n\n is a bug.
I have the impression from what I have looked at so far is that triple quoted strings are not handled as they should be. I opened #18583 for enhancing the module beyond what we have done here. |