From ba021c37a8e71f7d69c45b61a14429dcfbeeb6d6 Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Thu, 8 Feb 2024 16:48:24 +0500 Subject: [PATCH 1/2] less than and greater than rendering fixed --- src/static/js/ours/latex_markdown_html.js | 49 ++++++++++++----------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/static/js/ours/latex_markdown_html.js b/src/static/js/ours/latex_markdown_html.js index 4a0e645c2..6ee169f08 100644 --- a/src/static/js/ours/latex_markdown_html.js +++ b/src/static/js/ours/latex_markdown_html.js @@ -1,28 +1,29 @@ // Function to render Markdown, HTML and Latex and return updated content function renderMarkdownWithLatex(content) { - if(content === null){ - return [] - } - const parsedHtml = new DOMParser().parseFromString(marked(content), "text/html") - - const traverseAndRenderLatex = (node) => { - if (node.nodeType === Node.ELEMENT_NODE) { - const latexPattern = /\$\$([\s\S]*?)\$\$|\$([^\$\n]*?)\$/g - const hasLatex = latexPattern.test(node.textContent) - if (hasLatex) { - const tempDiv = document.createElement('div') - tempDiv.innerHTML = node.innerHTML.replace(latexPattern, (_, formula1, formula2) => { - const formula = formula1 || formula2 - return katex.renderToString(formula, { throwOnError: false }) - }); - node.innerHTML = tempDiv.innerHTML - } + if(content === null){ + return [] + } + const parsedHtml = new DOMParser().parseFromString(marked(content), "text/html") + + const traverseAndRenderLatex = (node) => { + if (node.nodeType === Node.ELEMENT_NODE) { + const latexPattern = /\$\$([\s\S]*?)\$\$|\$([^\$\n]*?)\$/g + const hasLatex = latexPattern.test(node.textContent) + if (hasLatex) { + const tempDiv = document.createElement('div') + tempDiv.innerHTML = node.innerHTML.replace(latexPattern, (_, formula1, formula2) => { + const formula = formula1 || formula2 + const decodedFormula = formula.replace(/</g, '<').replace(/>/g, '>') + return katex.renderToString(decodedFormula, { throwOnError: false }) + }); + node.innerHTML = tempDiv.innerHTML } - - node.childNodes.forEach(traverseAndRenderLatex) - }; - - traverseAndRenderLatex(parsedHtml.body) - - return parsedHtml.body.childNodes + } + + node.childNodes.forEach(traverseAndRenderLatex) + }; + + traverseAndRenderLatex(parsedHtml.body) + + return parsedHtml.body.childNodes } \ No newline at end of file From ede7d9f3e0d948ed7e731fd076e9bc7a1b40d1ee Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Mon, 4 Mar 2024 11:34:42 +0500 Subject: [PATCH 2/2] task action buttons fixed --- src/static/riot/tasks/management.tag | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/static/riot/tasks/management.tag b/src/static/riot/tasks/management.tag index a443ed465..78c0f793d 100644 --- a/src/static/riot/tasks/management.tag +++ b/src/static/riot/tasks/management.tag @@ -45,7 +45,7 @@ -
+
@@ -55,7 +55,7 @@
-
+
@@ -69,9 +69,8 @@ - + +