mirror of
https://github.com/litruv/Docs-Viewer.git
synced 2026-07-24 10:46:09 +10:00
Add Discord-style underline support and fix variable declaration in document loading
This commit is contained in:
@@ -14,4 +14,4 @@ If you need help or have questions:
|
|||||||
- Join the discussion on [Discord](https://discord.gg/b8ctQBaaax)
|
- Join the discussion on [Discord](https://discord.gg/b8ctQBaaax)
|
||||||
|
|
||||||
|
|
||||||
asdfds
|
__asdfds__
|
||||||
5
index.js
5
index.js
@@ -275,7 +275,7 @@ async function loadDocument(path) {
|
|||||||
|
|
||||||
processedContent = `# ${titleContent}\n\n${processedContent}`;
|
processedContent = `# ${titleContent}\n\n${processedContent}`;
|
||||||
|
|
||||||
const finalContent = processedContent.replace(/!\[\[(.*?)\]\]/g, (match, filename) => {
|
let finalContent = processedContent.replace(/!\[\[(.*?)\]\]/g, (match, filename) => {
|
||||||
const mediaPath = `${basePath}/images/${filename}`;
|
const mediaPath = `${basePath}/images/${filename}`;
|
||||||
|
|
||||||
if (filename.toLowerCase().endsWith('.mp4')) {
|
if (filename.toLowerCase().endsWith('.mp4')) {
|
||||||
@@ -288,6 +288,9 @@ async function loadDocument(path) {
|
|||||||
return `\n\n\n`;
|
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;
|
document.querySelector('.title-text .page-title').textContent = titleContent;
|
||||||
|
|
||||||
documentContent.className = 'markdown-content';
|
documentContent.className = 'markdown-content';
|
||||||
|
|||||||
Reference in New Issue
Block a user