Add Discord-style underline support and fix variable declaration in document loading

This commit is contained in:
2025-02-04 14:52:58 +11:00
parent 2d640e5248
commit e81a95277b
2 changed files with 5 additions and 2 deletions

View File

@@ -14,4 +14,4 @@ If you need help or have questions:
- Join the discussion on [Discord](https://discord.gg/b8ctQBaaax)
asdfds
__asdfds__

View File

@@ -275,7 +275,7 @@ async function loadDocument(path) {
processedContent = `# ${titleContent}\n\n${processedContent}`;
const finalContent = processedContent.replace(/!\[\[(.*?)\]\]/g, (match, filename) => {
let finalContent = processedContent.replace(/!\[\[(.*?)\]\]/g, (match, filename) => {
const mediaPath = `${basePath}/images/${filename}`;
if (filename.toLowerCase().endsWith('.mp4')) {
@@ -288,6 +288,9 @@ async function loadDocument(path) {
return `\n![${filename}](${mediaPath})\n\n`;
});
// Add Discord-style underline support: __text__ -> <u>text</u>
finalContent = finalContent.replace(/__(.*?)__/g, '<u>$1</u>');
document.querySelector('.title-text .page-title').textContent = titleContent;
documentContent.className = 'markdown-content';