diff options
Diffstat (limited to 'build.py')
-rwxr-xr-x | build.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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>') |