Update 'frontend.js'

This commit is contained in:
nodemixaholic 2024-03-31 21:42:50 +00:00
parent 930eb4fdf4
commit 4adc229b1e

View file

@ -15,14 +15,7 @@ function markdownToHTML(markdown) {
markdown = markdown.replace(/\*(.*)\*/gim, '<i>$1</i>'); markdown = markdown.replace(/\*(.*)\*/gim, '<i>$1</i>');
// Replace unordered list items with HTML list tags // Replace unordered list items with HTML list tags
markdown = markdown.replace(/^\s*-\s(.*)$/gim, '<li>$1</li>'); markdown = markdown.replace(/\* (.*?)(\n|$)/gim, '<li>$1</li>');
markdown = markdown.replace(/<\/li>\n<li>/gim, '</li><li>');
markdown = '<ul>' + markdown + '</ul>';
// Replace ordered list items with HTML list tags
markdown = markdown.replace(/^\s*\d+\.\s(.*)$/gim, '<li>$1</li>');
markdown = markdown.replace(/<\/li>\n<li>/gim, '</li><li>');
markdown = '<ol>' + markdown + '</ol>';
// Replace inline code with HTML <code> tag // Replace inline code with HTML <code> tag
markdown = markdown.replace(/`(.*?)`/gim, '<code>$1</code>'); markdown = markdown.replace(/`(.*?)`/gim, '<code>$1</code>');