[BUG] Editing a blog comment only captures the first paragraph of the comment
-
Hello.
I recently noticed a little bug with the blogs - I don't know if it affects the user blogs (I don't use those), but it does affect the Desktop Snapshots blog for example.
Here goes: clicking 'Edit' on a comment that spans more than one paragraph discards everything after the first paragraph. To illustrate this, say you post the following (Lorem ipsum text for illustrative purposes):
Do ea ut occaecat deserunt. Id laboris magna est.
clicking 'Edit' would only insert the following into the text field:
Do ea ut occaecat deserunt.
Since this seems to be a front-end issue, I took the liberty to try to fix it and I think I managed to do so.
Basically, in
vivaldi-comments.js
, replacing thisformInput.innerHTML = postBody.getElementsByTagName('p')[0].innerHTML.replace(/<[^>]+>/gm, '');
with something like this:
var postParagraphs = Array.from(postBody.getElementsByTagName('p')); formInput.innerHTML = postParagraphs.map(p => p.innerHTML.replace(/<[^>]+>/gm, '')).join('\n\n');
seems to work. No security implications whatsoever (that I can see), so I hope it's not a problem that I post this publicly.
-
@killchain Well spotted
I think most users comment directly on the forum posts, not on the blog itself, so it's not been noticed.
-
@Gwen-Dragon Submitted, issue reference 24413698773.
-
I moved the ticket to a different project, so now the ticket number to follow is VIV-978.
-
Any development on this? I recently saw the bug again.
-
@killchain Unfortunately, not yet.
-