Add Markdown chapter content
This commit is contained in:
1 parent
7626417c46
commit
4de130e608
9 files changed
+236
-39
No files matched your search
+3
-5
@@ -32,10 +32,9 @@ function renderJourney() {
|
||||
currentJourney.markers.forEach((marker, idx) => {
|
||||
const title = marker.title || `Chapter ${idx + 1}`;
|
||||
const date = marker.date ? `<span class="marker-date">${new Date(marker.date).toLocaleDateString()}</span>` : '';
|
||||
const content = marker.description ? escapeHtml(marker.description).replace(/\n/g, '<br>') : '';
|
||||
const content = marker.description ? renderMarkdown(marker.description) : '';
|
||||
marker.images = getMarkerImages(marker);
|
||||
const images = getMarkerImagesHtml(marker.images, idx, canEdit);
|
||||
const video = marker.videoUrl ? `<iframe src="${marker.videoUrl}" frameborder="0" allowfullscreen></iframe>` : '';
|
||||
chaptersHtml += `
|
||||
<div class="chapter" data-marker-id="${marker.id || idx}">
|
||||
<div class="chapter-header">
|
||||
@@ -44,8 +43,7 @@ function renderJourney() {
|
||||
</div>
|
||||
${images}
|
||||
${canEdit ? getImageToolsHtml(idx) : ''}
|
||||
${video}
|
||||
<div class="chapter-content">${content}</div>
|
||||
<div class="chapter-content markdown-content">${content}</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
@@ -63,7 +61,7 @@ function renderJourney() {
|
||||
${currentJourney.visibility === 'shared' && !isOwner ? `<span class="badge">${canEdit ? 'Shared edit' : 'Shared'}</span>` : ''}
|
||||
</div>
|
||||
${currentJourney.image ? `<img class="post-image" src="${currentJourney.image}" alt="${currentJourney.title}">` : ''}
|
||||
<div class="post-description">${escapeHtml(currentJourney.description).replace(/\n/g, '<br>')}</div>
|
||||
<div class="post-description markdown-content">${renderMarkdown(currentJourney.description)}</div>
|
||||
${chaptersHtml}
|
||||
${canEdit || isOwner ? `
|
||||
<div style="margin-top: var(--size-4); display: flex; gap: var(--size-2);">
|
||||
|
||||
Reference in new issue
Block a user