=> 3424f494ef1b2e6643d09702151088244c48def5
[1mdiff --git a/50_bubble.py b/50_bubble.py[m [1mindex 6b41984..dc31000 100644[m [1m--- a/50_bubble.py[m [1m+++ b/50_bubble.py[m [36m@@ -353,7 +353,7 @@[m [mBubble is open source:[m src += '\n'[m [m if segment.type == Segment.TEXT:[m [31m- src += prefix_links(segment.content, link_prefix) + '\n'[m [32m+[m[32m src += prefix_links(strip_invalid(segment.content), link_prefix) + '\n'[m last_type = segment.type[m [m elif segment.type in [Segment.LINK, Segment.IMAGE, Segment.ATTACHMENT]:[m [1mdiff --git a/model.py b/model.py[m [1mindex b9c28bd..2a99366 100644[m [1m--- a/model.py[m [1m+++ b/model.py[m [36m@@ -9,7 +9,8 @@[m [mfrom gmcapsule import Identity[m from OpenSSL import crypto[m from typing import Union[m from utils import ago_text, clean_title, parse_at_names, shorten_text, strip_links, \[m [31m- GeminiError, UTC, INNER_LINK_PREFIX, gemini_fetch, certificate_sha256, pubkey_sha256[m [32m+[m[32m GeminiError, UTC, INNER_LINK_PREFIX, gemini_fetch, certificate_sha256, pubkey_sha256, \[m [32m+[m[32m strip_invalid[m [m [m def parse_asn1_time(asn1_bytes):[m [36m@@ -1361,7 +1362,7 @@[m [mclass Database:[m values = [][m if content != None:[m set_stm.append('content=?')[m [31m- values.append(content)[m [32m+[m[32m values.append(strip_invalid(content))[m old_content = segment.content[m segment.content = content[m if url != None:[m [1mdiff --git a/utils.py b/utils.py[m [1mindex 99dfa87..46fdff8 100644[m [1m--- a/utils.py[m [1m+++ b/utils.py[m [36m@@ -163,6 +163,10 @@[m [mdef prefix_links(src, prefix):[m return '\n'.join(lines)[m [m [m [32m+[m[32mdef strip_invalid(src):[m [32m+[m[32m return src.replace('\x00', '')[m [32m+[m [32m+[m def shorten_text(text, n):[m """Truncate and cut at white or word boundary."""[m if len(text) > n:[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).