master #34
@@ -1784,10 +1784,11 @@ class CommentSystem {
|
|||||||
if (trimmed.startsWith('>') && !trimmed.match(/^>>\d+/)) {
|
if (trimmed.startsWith('>') && !trimmed.match(/^>>\d+/)) {
|
||||||
const quoteContent = line.substring(line.indexOf('>') + 1);
|
const quoteContent = line.substring(line.indexOf('>') + 1);
|
||||||
const quoteEmojis = window.f0ckSession?.quote_emojis === true;
|
const quoteEmojis = window.f0ckSession?.quote_emojis === true;
|
||||||
|
const escapedQuote = quoteContent.replace(/>/g, '>');
|
||||||
const renderedContent = quoteEmojis
|
const renderedContent = quoteEmojis
|
||||||
? quoteContent.replace(/:([a-z0-9_]+):/g, (m, n) => this.renderEmoji(m, n))
|
? escapedQuote.replace(/:([a-z0-9_]+):/g, (m, n) => this.renderEmoji(m, n))
|
||||||
: quoteContent;
|
: escapedQuote;
|
||||||
return `<span class="greentext">>${renderedContent.replace(/>/g, '>')}</span>`;
|
return `<span class="greentext">>${renderedContent}</span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Per-line limit to prevent marked.parse recursion on single giant lines
|
// 2. Per-line limit to prevent marked.parse recursion on single giant lines
|
||||||
|
|||||||
@@ -268,10 +268,11 @@
|
|||||||
// Manual greentext handling — apply emoji if the user preference allows it
|
// Manual greentext handling — apply emoji if the user preference allows it
|
||||||
const quoteContent = line.substring(line.indexOf('>') + 1);
|
const quoteContent = line.substring(line.indexOf('>') + 1);
|
||||||
const quoteEmojis = window.f0ckSession?.quote_emojis === true;
|
const quoteEmojis = window.f0ckSession?.quote_emojis === true;
|
||||||
|
const escapedQuote = quoteContent.replace(/>/g, '>');
|
||||||
const rendered = quoteEmojis
|
const rendered = quoteEmojis
|
||||||
? quoteContent.replace(/:([a-z0-9_]+):/g, (m, n) => renderEmoji(m, n))
|
? escapedQuote.replace(/:([a-z0-9_]+):/g, (m, n) => renderEmoji(m, n))
|
||||||
: quoteContent;
|
: escapedQuote;
|
||||||
return `<span class="greentext">>${rendered.replace(/>/g, '>')}</span>`;
|
return `<span class="greentext">>${rendered}</span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Per-line limit to prevent marked.parse recursion on single giant lines
|
// Per-line limit to prevent marked.parse recursion on single giant lines
|
||||||
|
|||||||
@@ -306,7 +306,12 @@ if (!window.UserCommentSystem) {
|
|||||||
const trimmed = line.trimStart();
|
const trimmed = line.trimStart();
|
||||||
if (trimmed.startsWith('>') && !trimmed.match(/^>>\d+/)) {
|
if (trimmed.startsWith('>') && !trimmed.match(/^>>\d+/)) {
|
||||||
const quoteContent = line.substring(line.indexOf('>') + 1);
|
const quoteContent = line.substring(line.indexOf('>') + 1);
|
||||||
return `<span class="greentext">>${quoteContent.replace(/>/g, '>')}</span>`;
|
const quoteEmojis = window.f0ckSession?.quote_emojis === true;
|
||||||
|
const escapedQuote = quoteContent.replace(/>/g, '>');
|
||||||
|
const rendered = quoteEmojis
|
||||||
|
? escapedQuote.replace(/:([a-z0-9_]+):/g, (m, n) => this.renderEmoji(m, n))
|
||||||
|
: escapedQuote;
|
||||||
|
return `<span class="greentext">>${rendered}</span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Per-line limit
|
// Per-line limit
|
||||||
|
|||||||
Reference in New Issue
Block a user