Formatting content before saving patch

main
Bob Mottram 2020-05-02 17:01:58 +00:00
parent 79048c29b9
commit b5053a9155
1 changed files with 5 additions and 1 deletions

View File

@ -1708,8 +1708,12 @@ def gitPatchNotify(baseDir: str, handle: str,
patchFile = accountDir + '/.newPatch'
with open(patchFile, 'w') as fp:
fp.write(subject)
contentStr = content.replace('<br>', '\n').replace('<br \>', '\n')
contentStr = contentStr.replace('<p>', '').replace('</p>', '\n')
if 'From ' in contentStr:
contentStr = contentStr.split('From ', 1)[1]
with open(patchFile + 'Content', 'w') as fp:
fp.write(content)
fp.write(contentStr)
def groupHandle(baseDir: str, handle: str) -> bool: