forked from barryclark/jekyll-now
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-markdown.html
More file actions
59 lines (54 loc) · 1.98 KB
/
test-markdown.html
File metadata and controls
59 lines (54 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Markdown Test</title>
<!-- Add Marked.js for Markdown parsing -->
<script src="https://cdn.jsdelivr.net/npm/marked@4.3.0/marked.min.js"></script>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
pre {
background-color: #f5f5f5;
padding: 10px;
border-radius: 5px;
}
code {
font-family: monospace;
}
</style>
</head>
<body>
<h1>Markdown Test</h1>
<div id="content">Loading...</div>
<script>
document.addEventListener('DOMContentLoaded', async function() {
try {
console.log('Attempting to load review.md...');
const response = await fetch('papers/example-paper/review.md');
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const text = await response.text();
console.log('Content loaded, length:', text.length);
console.log('First 100 characters:', text.substring(0, 100));
if (typeof marked === 'undefined') {
document.getElementById('content').innerHTML = 'Error: marked.js is not loaded';
return;
}
const html = marked.parse(text);
document.getElementById('content').innerHTML = html;
console.log('Markdown rendered successfully');
} catch (error) {
console.error('Error:', error);
document.getElementById('content').innerHTML = `Error loading or parsing Markdown: ${error.message}`;
}
});
</script>
</body>
</html>