mirror of
https://github.com/litruv/Docs-Viewer.git
synced 2026-07-24 02:36:07 +10:00
Add Discord-style underline support and fix variable declaration in document loading
This commit is contained in:
5
index.js
5
index.js
@@ -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\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';
|
||||
|
||||
Reference in New Issue
Block a user