main
Bob Mottram 2020-05-02 18:09:54 +00:00
parent 6e8ad06f21
commit 25971816a0
1 changed files with 2 additions and 2 deletions

4
git.py
View File

@ -7,7 +7,7 @@ __email__ = "bob@freedombone.net"
__status__ = "Production" __status__ = "Production"
import os import os
import urllib.parse import html
def gitFormatContent(content: str) -> str: def gitFormatContent(content: str) -> str:
@ -16,7 +16,7 @@ def gitFormatContent(content: str) -> str:
""" """
contentStr = content.replace('<br>', '\n').replace('<br />', '\n') contentStr = content.replace('<br>', '\n').replace('<br />', '\n')
contentStr = contentStr.replace('<p>', '').replace('</p>', '\n') contentStr = contentStr.replace('<p>', '').replace('</p>', '\n')
contentStr = urllib.parse.unquote(contentStr) contentStr = html.unescape(contentStr)
if 'From ' in contentStr: if 'From ' in contentStr:
contentStr = 'From ' + contentStr.split('From ', 1)[1] contentStr = 'From ' + contentStr.split('From ', 1)[1]
return contentStr return contentStr