=> 16a0bd6505f53e882812ac0fbc9920380977c8e2
[1mdiff --git a/50_bubble.py b/50_bubble.py[m [1mindex aaf8091..e1d7aa8 100644[m [1m--- a/50_bubble.py[m [1m+++ b/50_bubble.py[m [36m@@ -247,6 +247,9 @@[m [mBubble is open source:[m title_prefix = f'[#{post.issueid}] ' if post.issueid else ''[m src += f'# {title_prefix}{post.title}\n\n'[m [m [32m+[m[32m # In comments, differentiate between content links and UI links for clarity.[m [32m+[m[32m link_prefix = '— ' if post.parent else ''[m [32m+[m last_type = None[m for segment in self.db.get_segments(post, poll=False):[m # Optionally, separate by newline.[m [36m@@ -256,11 +259,17 @@[m [mBubble is open source:[m src += '\n'[m [m if segment.type == Segment.TEXT:[m [31m- src += segment.content + '\n'[m [32m+[m[32m src += prefix_links(segment.content, link_prefix) + '\n'[m last_type = segment.type[m [m elif segment.type in [Segment.LINK, Segment.IMAGE, Segment.ATTACHMENT]:[m [31m- src += f'=> {segment.url} {segment.content}\n'[m [32m+[m[32m label = segment.content[m [32m+[m[32m if len(label) == 0:[m [32m+[m[32m # No label; show the URL sans `gemini`` scheme.[m [32m+[m[32m label = segment.url[m [32m+[m[32m if label.startswith('gemini://'):[m [32m+[m[32m label = label[9:][m [32m+[m[32m src += f'=> {segment.url} {link_prefix}{label}\n'[m last_type = segment.type[m [m return src[m [1mdiff --git a/feeds.py b/feeds.py[m [1mindex f82f9d0..0e164b9 100644[m [1m--- a/feeds.py[m [1m+++ b/feeds.py[m [36m@@ -280,7 +280,7 @@[m [mdef make_post_page(session, post):[m # Commits are shown as links to the Git viewer.[m if isinstance(cmt, Commit):[m rendered_comments.append([m [31m- f'=> {repo.view_url}/{cmt.hash} 🛢️ {cmt.hash[:8]} · {clean_title(cmt.msg)}\n' +[m [32m+[m[32m f'=> {repo.view_url}/{cmt.hash} Commit {cmt.hash[:8]} · {clean_title(cmt.msg)}\n' +[m ago_text(cmt.ts) + '\n'[m )[m continue[m [1mdiff --git a/model.py b/model.py[m [1mindex 8f2ece0..022eb29 100644[m [1m--- a/model.py[m [1m+++ b/model.py[m [36m@@ -987,6 +987,8 @@[m [mclass Database:[m seg_content = seg.content.strip()[m if len(seg_content) == 0:[m seg_content = seg.url[m [32m+[m[32m if seg_content.startswith('gemini://'):[m [32m+[m[32m seg_content = seg_content[9:] # Omit default scheme.[m render += f'=> {seg.url} — {seg_content}\n'[m break[m [m [1mdiff --git a/utils.py b/utils.py[m [1mindex 287b132..62f1770 100644[m [1m--- a/utils.py[m [1m+++ b/utils.py[m [36m@@ -97,6 +97,26 @@[m [mdef clean_tinylog(text):[m return '\n'.join(clean)[m [m [m [32m+[m[32mdef prefix_links(src, prefix):[m [32m+[m[32m """Add a prefix to link labels."""[m [32m+[m[32m if not prefix:[m [32m+[m[32m return src[m [32m+[m[32m lines = [][m [32m+[m[32m pattern = re.compile(r'^\s*=>\s*([^ ]+)(\s+(.*))?$')[m [32m+[m[32m for line in src.split('\n'):[m [32m+[m[32m m = pattern.match(line)[m [32m+[m[32m if m:[m [32m+[m[32m label = m[3].strip() if m[3] and len(m[3]) else ''[m [32m+[m[32m if len(label) == 0:[m [32m+[m[32m label = m[1][m [32m+[m[32m # Omit gemini scheme.[m [32m+[m[32m if label.startswith('gemini://'):[m [32m+[m[32m label = label[9:][m [32m+[m[32m line = f'=> {m[1]} {prefix}{label}'[m [32m+[m[32m lines.append(line)[m [32m+[m[32m return '\n'.join(lines)[m [32m+[m [32m+[m def shorten_text(text, n):[m """Truncate and cut at white or word boundary."""[m text = text[:n][m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).