更新 static/js/lib/marked.min.js

This commit is contained in:
2025-06-06 16:53:31 +08:00
parent c555ca89b7
commit 64259980e4

View File

@ -1,16 +1,16 @@
// Simplified marked.min.js for local testing // Simplified marked.min.js for local testing
var marked = { var marked = {
parse: function (markdownString) { parse: function (markdownString) {
// Basic markdown to HTML conversion for testing // Basic markdown to HTML conversion for testing
return markdownString return markdownString
.replace(/^# (.*$)/gim, '<h1>$1</h1>') .replace(/^# (.*$)/gim, '<h1>$1</h1>')
.replace(/^## (.*$)/gim, '<h2>$1</h2>') .replace(/^## (.*$)/gim, '<h2>$1</h2>')
.replace(/^### (.*$)/gim, '<h3>$1</h3>') .replace(/^### (.*$)/gim, '<h3>$1</h3>')
.replace(/\*\*(.*?)\*\*/gim, '<strong>$1</strong>') .replace(/\*\*(.*?)\*\*/gim, '<strong>$1</strong>')
.replace(/\*(.*?)\*/gim, '<em>$1</em>') .replace(/\*(.*?)\*/gim, '<em>$1</em>')
.replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2">$1</a>') .replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2">$1</a>')
.replace(/`([^`]+)`/g, '<code>$1</code>') .replace(/`([^`]+)`/g, '<code>$1</code>')
.replace(/```([\s\S]*?)```/g, '<pre><code>$1</code></pre>') .replace(/```([\s\S]*?)```/g, '<pre><code>$1</code></pre>')
.replace(/\n/g, '<br>'); .replace(/\n/g, '<br>');
} }
}; };