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