From 791893216a3cb043781195a4ce6c7fb3ad82539b Mon Sep 17 00:00:00 2001
From: Martin Fischer <martin@push-f.com>
Date: Sat, 27 Nov 2021 08:47:52 +0100
Subject: html: turn `` into <code></code>

---
 build.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/build.py b/build.py
index 51b2146..5e4019c 100755
--- a/build.py
+++ b/build.py
@@ -1,9 +1,10 @@
 #!/usr/bin/env python3
 import glob
+import html
 import json
 import os
+import re
 import shutil
-import html
 
 import toml
 
@@ -85,8 +86,9 @@ def write_features(f, feature_data):
         if url:
             f.write(f' href="{url}"')
         f.write('>')
-        # TODO: convert `..` into <code>..</code>
-        f.write(html.escape(data['title']))
+        title = html.escape(data['title'])
+        title = re.sub('`(.+?)`', lambda m: '<code>{}</code>'.format(m.group(1)), title)
+        f.write(title)
         f.write('</a></li>')
     f.write('</ul>')
 
-- 
cgit v1.2.3