ctml Hi, I have the same issue and I solved it. It happened because this code in forum.js
$('.Post-body').each(function () {
var str = $(this).text();
if ($.trim(str).length > max) {
var subStr = str.substring(0, max);
var hiddenStr = str.substring(max, $.trim(str).length);
var ReadMore = app.translator.trans('flarum-ext-readmore.forum.readmore');
$(this).text(subStr);
$(this).append(' <a href="javascript:void(0);" class="linkReadMore">' + ReadMore + '</a>');
$(this).append('<span class="addText">' + hiddenStr + '</span>');
}
It adds one more "Readmore" text to the "hiddenStr" after every ".each" loop. So, the more post you have, the more "Readmore" text added. What I did is add one more code likes this to check if there is any "Readmore" text added and remove it as below:
$('.Post-body').each(function () {
var str = $(this).text();
if ($.trim(str).length > max) {
var subStr = str.substring(0, max);
var hiddenStr = str.substring(max, $.trim(str).length);
var ReadMore = app.translator.trans('flarum-ext-readmore.forum.readmore');
if (hiddenStr.substring(0, $.trim(Readmore).length) == Readmore){hiddenStr = hiddenStr.substring($.trim(Readmore).length, $.trim(hiddenStr).length)};
$(this).text(subStr);
$(this).append(' <a href="javascript:void(0);" class="linkReadMore">' + ReadMore + '</a>');
$(this).append('<span class="addText">' + hiddenStr + '</span>');
}
And I removed 1 empty space before the link at here to make the code work:
$(this).append('<a href="javascript:void(0);" class="linkReadMore">' + ReadMore + '</a>');
I am not good as the coding but I hope this help.