git ssb

0+

Grey the earthling / scuttleblog



Commit 91072869fd8d2662c89bd6f090600bfe0ee8f85f

Post titles: strip any initial '#' before limiting length

Greg K Nicholson committed on 10/15/2017, 11:58:04 PM
Parent: 0cc15bcd9a37b318d9087f8f0a7e09fee879a308

Files changed

scuttleblog.pychanged
scuttleblog.pyView
@@ -63,8 +63,9 @@
6363
6464 def define_post_text(text):
6565 text = text.strip()
6666 title = text.splitlines()[0]
67 + title = re.sub('^#+\s+', '', title)
6768 maxlength = 140
6869 ellipsis = '...'
6970 if len(title) > maxlength:
7071 title = title[:maxlength].rsplit(' ', 1)[0] + ellipsis
@@ -73,9 +74,8 @@
7374 if len(text.splitlines()) > 1:
7475 body = ''.join(text.splitlines(keepends=True)[1:]).strip()
7576 else:
7677 body = ''
77- title = re.sub('^#+\s+', '', title)
7878 return {'title': title, 'body': body}
7979
8080 def build_post_structure(p):
8181 post = {}

Built with git-ssb-web