git ssb

0+

Grey the earthling / gkn.me.uk



Commit 7155a07c0cdf67519fc55a08e30007e927e06398

Parse Gemini-format links into HTML links

Grey Nicholson committed on 5/15/2022, 5:51:42 PM
Parent: 59c0f9d88cdd78f718fca44638dffb31ada0c2a1

Files changed

generator/common.pychanged
generator/common.pyView
@@ -58,8 +58,20 @@
5858 colour_class = f"month-{list(reversed(months))[0].month:02d}"
5959
6060
6161 def convert_to_html(hypertext):
62 + hypertext = "\n".join(
63 + [
64 + re.sub(r"^=>\s*(\S+)\s+(.*)$", r'<p><a href="\1">\2</a></p>', line)
65 + for line in hypertext.split("\n")
66 + ]
67 + )
68 + hypertext = "\n".join(
69 + [
70 + re.sub(r"^=>\s*(\S+)$", r'<p><a href="\1">\1</a></p>', line)
71 + for line in hypertext.split("\n")
72 + ]
73 + )
6274 return marko.convert(hypertext)
6375
6476
6577 def entries_in_series(series):

Built with git-ssb-web