forked from rDrama/rDrama
1
0
Fork 0

fix show more button

master
Aevann 2023-01-01 14:26:25 +02:00
parent c3a5418d3a
commit f7874b2c4e
2 changed files with 5 additions and 1 deletions

View File

@ -283,6 +283,10 @@ function showmore() {
btn.innerHTML = 'SHOW LESS'
}
for (const element of document.getElementsByClassName('showmore')) {
element.onclick = showmore;
}
function formatDate(d) {
let year = d.getFullYear();
let monthAbbr = d.toLocaleDateString('en-us', {month: 'short'});

View File

@ -411,7 +411,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
sanitized = sanitized.replace('\n','')
if showmore and len(sanitized) > 3500:
sanitized = showmore_regex.sub(r'\1<p><button class="showmore" data-nonce="{{g.nonce}}" data-onclick="showmore()">SHOW MORE</button></p><d class="d-none">\2</d>', sanitized, count=1)
sanitized = showmore_regex.sub(r'\1<p><button class="showmore" data-nonce="{{g.nonce}}">SHOW MORE</button></p><d class="d-none">\2</d>', sanitized, count=1)
return sanitized.strip()