Git patch format in web interface

main
Bob Mottram 2020-05-02 19:39:09 +00:00
parent e4c9365de0
commit 8f99801878
1 changed files with 6 additions and 1 deletions

View File

@ -69,6 +69,7 @@ from happening import thisWeeksEventsCheck
from happening import getCalendarEvents from happening import getCalendarEvents
from happening import getTodaysEvents from happening import getTodaysEvents
from git import isGitPatch from git import isGitPatch
from git import gitFormatContent
def updateAvatarImageCache(session, baseDir: str, httpPrefix: str, def updateAvatarImageCache(session, baseDir: str, httpPrefix: str,
@ -3977,7 +3978,11 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
postJsonObject['object']['content']): postJsonObject['object']['content']):
contentStr = '<div class="message">' + contentStr + '</div>' contentStr = '<div class="message">' + contentStr + '</div>'
else: else:
contentStr = '<div class="gitpatch">' + contentStr + '</div>' patchStr = gitFormatContent(postJsonObject['object']['content'])
contentStr = \
'<div class="gitpatch">' + \
patchStr.replace('\n','<br>') + \
'</div>'
postHtml = '' postHtml = ''
if boxName != 'tlmedia': if boxName != 'tlmedia':