fix: HTML code blocks no longer break chat flow

- HTML code blocks now show as syntax-highlighted code with a Preview button
- Added sandboxed iframe HTML preview panel
- Added 'Open in Browser' button for full-screen preview
- Raw HTML from AI responses no longer injected into chat DOM
This commit is contained in:
admin
2026-05-21 18:23:15 +04:00
Unverified
parent 5125725ea7
commit e2a97a958a
3 changed files with 98 additions and 2 deletions

View File

@@ -431,6 +431,33 @@ a:hover { text-decoration: underline; }
}
.copy-btn:hover, .download-btn:hover { background: var(--accent); color: white; }
.html-preview-block { margin: 8px 0; }
.html-preview-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 12px;
background: var(--bg-tertiary);
border-radius: 8px 8px 0 0;
font-size: 12px;
color: var(--text-secondary);
border: 1px solid var(--border);
border-bottom: none;
}
.html-preview-bar + pre { border-top-left-radius: 0; border-top-right-radius: 0; }
.html-preview-btn {
background: linear-gradient(135deg, #6c63ff, #a855f7);
border: none;
color: white;
padding: 4px 14px;
border-radius: 4px;
font-size: 11px;
font-weight: 600;
cursor: pointer;
transition: opacity var(--transition);
}
.html-preview-btn:hover { opacity: 0.85; }
.msg-actions {
display: flex;
gap: 6px;