From 410dc9ba14f073f26a36f1887ee2f74000e44351 Mon Sep 17 00:00:00 2001 From: Mohd Raza Date: Sun, 23 Mar 2025 02:49:47 +0530 Subject: [PATCH 1/3] make issue number clickable-#3364 --- website/static/js/issue.js | 33 +++++++++++++- website/templates/issue.html | 88 ++++++++++++++++++++++++++++++------ 2 files changed, 107 insertions(+), 14 deletions(-) diff --git a/website/static/js/issue.js b/website/static/js/issue.js index 474a65ac5d..2888e2ac09 100644 --- a/website/static/js/issue.js +++ b/website/static/js/issue.js @@ -670,4 +670,35 @@ document.addEventListener('DOMContentLoaded', () => { .replace(/"/g, '"') .replace(/'/g, '''); } -}); \ No newline at end of file + + processIssueReferences(); +}); + +function processIssueReferences() { + // Process markdown content + const bugReportElement = document.getElementById('bug_report'); + if (bugReportElement && window.markdownit) { + const md = new window.markdownit(); + const markdownContent = bugReportElement.getAttribute('data-markdown') || bugReportElement.textContent; + + let renderedHtml = md.render(markdownContent); + renderedHtml = renderedHtml.replace( + /#(\d+)/g, + '#$1' + ); + + bugReportElement.innerHTML = renderedHtml; + } + + // Process plain text descriptions + const issueDescriptionElement = document.querySelector('.issue-description'); + if (issueDescriptionElement) { + const originalText = issueDescriptionElement.textContent; + const transformedText = originalText.replace( + /#(\d+)/g, + '#$1' + ); + + issueDescriptionElement.innerHTML = transformedText; + } +} \ No newline at end of file diff --git a/website/templates/issue.html b/website/templates/issue.html index 207f530c0c..e9ff89d76c 100644 --- a/website/templates/issue.html +++ b/website/templates/issue.html @@ -87,13 +87,18 @@
-
-

{{ object.description|escapejs }}

- {% if object.markdown_description %} -

{{ object.markdown_description }}

- {% endif %} +
+
+

{{ object.description|escapejs }}

+ {% if object.markdown_description %} +

+ +

+ {% endif %} +
+ - +