feat: Improve quote format with guillemets and styling

- Changed quote format to: @[Username]: »quoted text«
- Added processQuotes() to detect and style »text« patterns
- Quote styling: italic, gray background, left border
- Different styling for own messages vs others

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-01-19 10:29:59 +01:00
parent 936698ca46
commit b2418a50d3
3 changed files with 35 additions and 2 deletions
+1 -1
View File
@@ -782,7 +782,7 @@ function quoteTo(username, content) {
quotedText = truncated + '...';
}
input.value = `@[${username}] "${quotedText}" `;
input.value = `@[${username}]: »${quotedText}« `;
updateCharCounter();
input.focus();
}
+18 -1
View File
@@ -18,7 +18,10 @@ function processMessageContent(content) {
// 1. Convert @[Username] mentions to badges
processed = processMentions(processed);
// 2. Convert URLs to links (and images to thumbnails)
// 2. Convert »quoted text« to styled quotes
processed = processQuotes(processed);
// 3. Convert URLs to links (and images to thumbnails)
processed = processUrls(processed);
return processed;
@@ -40,6 +43,20 @@ function processMentions(text) {
});
}
/**
* Convert »quoted text« to styled quote blocks
* @param {string} text - HTML-escaped text
* @returns {string} - Text with styled quotes
*/
function processQuotes(text) {
// Match »...« pattern (guillemets)
const quotePattern = /»([^«]+)«/g;
return text.replace(quotePattern, (_match, quoted) => {
return `<span class="quote-text">»${quoted}«</span>`;
});
}
/**
* Convert URLs to clickable links and images to thumbnails
* @param {string} text - HTML-escaped text