aboutsummaryrefslogtreecommitdiff
path: root/cgit/filters/html-transform.py
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2026-07-05 21:35:22 +0530
committerAkshay Nair <phenax5@gmail.com>2026-07-05 21:35:22 +0530
commitc20d74cb5793d5821eadb2f96ac2e8e336e9a94a (patch)
tree12b4718b74083d9fc9ac3b879d229898db4148c3 /cgit/filters/html-transform.py
parentb3d4fe72d35d7542f54b8c81e2f59f66723df1df (diff)
downloadbacchus-remote-c20d74cb5793d5821eadb2f96ac2e8e336e9a94a.tar.gz
bacchus-remote-c20d74cb5793d5821eadb2f96ac2e8e336e9a94a.zip
Switch to md4c for markdown rendering
Diffstat (limited to 'cgit/filters/html-transform.py')
-rwxr-xr-xcgit/filters/html-transform.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/cgit/filters/html-transform.py b/cgit/filters/html-transform.py
index 9fc7aec..e12ffda 100755
--- a/cgit/filters/html-transform.py
+++ b/cgit/filters/html-transform.py
@@ -16,12 +16,12 @@ def is_relative_path(url):
if not url: return False
return not url.startswith("/") and not is_absolute_url(url)
-def linkify(text, make_link):
- url_pattern = r'(?<!\S)(https?://\S+?)([.,!?;:]?(?=\s|$))'
- def replace(m):
- url, trail = m.group(1), m.group(2)
- return make_link(url) + trail
- return re.sub(url_pattern, replace, text)
+# def linkify(text, make_link):
+# url_pattern = r'(?<!\S)(https?://\S+?)([.,!?;:]?(?=\s|$))'
+# def replace(m):
+# url, trail = m.group(1), m.group(2)
+# return make_link(url) + trail
+# return re.sub(url_pattern, replace, text)
class LinkRewriter(HTMLParser):
def __init__(self):
@@ -62,9 +62,9 @@ class LinkRewriter(HTMLParser):
self.output.append(f"</{tag}>")
def handle_data(self, data):
- data_with_links = linkify(data,
- lambda url: self._build_tag("a", [('href', url)]) + html.escape(url) + "</a>")
- self.output.append(data_with_links)
+ # data_with_links = linkify(data,
+ # lambda url: self._build_tag("a", [('href', url)]) + html.escape(url) + "</a>")
+ self.output.append(data)
def handle_entityref(self, name):
self.output.append(f"&{name};")