mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 07:05:43 -03:00
Add markdown support for changelog in modal
- Introduced a simple markdown parser to convert markdown syntax in changelog items to HTML. - Updated modal CSS to style markdown elements, enhancing the presentation of changelog items. - Improved user experience by allowing formatted text in changelog, including bold, italic, code, and links.
This commit is contained in:
@@ -515,3 +515,43 @@ input:checked + .toggle-slider:before {
|
|||||||
margin-top: var(--space-1);
|
margin-top: var(--space-1);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add styles for markdown elements in changelog */
|
||||||
|
.changelog-item ul {
|
||||||
|
padding-left: 20px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.changelog-item li {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.changelog-item strong {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.changelog-item em {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.changelog-item code {
|
||||||
|
background: rgba(0, 0, 0, 0.05);
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="dark"] .changelog-item code {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.changelog-item a {
|
||||||
|
color: var(--lora-accent);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.changelog-item a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
@@ -178,7 +178,8 @@ export class UpdateService {
|
|||||||
if (this.updateInfo.changelog && this.updateInfo.changelog.length > 0) {
|
if (this.updateInfo.changelog && this.updateInfo.changelog.length > 0) {
|
||||||
this.updateInfo.changelog.forEach(item => {
|
this.updateInfo.changelog.forEach(item => {
|
||||||
const listItem = document.createElement('li');
|
const listItem = document.createElement('li');
|
||||||
listItem.textContent = item;
|
// Parse markdown in changelog items
|
||||||
|
listItem.innerHTML = this.parseMarkdown(item);
|
||||||
changelogList.appendChild(listItem);
|
changelogList.appendChild(listItem);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -201,6 +202,25 @@ export class UpdateService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Simple markdown parser for changelog items
|
||||||
|
parseMarkdown(text) {
|
||||||
|
if (!text) return '';
|
||||||
|
|
||||||
|
// Handle bold text (**text**)
|
||||||
|
text = text.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
|
||||||
|
|
||||||
|
// Handle italic text (*text*)
|
||||||
|
text = text.replace(/\*(.*?)\*/g, '<em>$1</em>');
|
||||||
|
|
||||||
|
// Handle inline code (`code`)
|
||||||
|
text = text.replace(/`(.*?)`/g, '<code>$1</code>');
|
||||||
|
|
||||||
|
// Handle links [text](url)
|
||||||
|
text = text.replace(/\[(.*?)\]\((.*?)\)/g, '<a href="$2" target="_blank">$1</a>');
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
toggleUpdateModal() {
|
toggleUpdateModal() {
|
||||||
const updateModal = modalManager.getModal('updateModal');
|
const updateModal = modalManager.getModal('updateModal');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user