Trim comments before returning them

This commit is contained in:
Alex Corn 2021-07-22 03:25:47 -04:00
parent 851c14bd93
commit cd90d7a563
No known key found for this signature in database
GPG Key ID: E51989A3E7A27FDF

View File

@ -240,14 +240,14 @@ SteamCommunity.prototype.getUserComments = function(userID, options, callback) {
return {
id: $elem.attr("id").split("_")[1],
author: {
id: new SteamID("[U:1:" + $elem.find("[data-miniprofile]").data("miniprofile") + "]"),
steamID: new SteamID("[U:1:" + $elem.find("[data-miniprofile]").data("miniprofile") + "]"),
name: $elem.find("bdi").text(),
avatar: $elem.find(".playerAvatar img[src]").attr("src"),
state: $elem.find(".playerAvatar").attr("class").split(" ").pop()
},
date: new Date($elem.find(".commentthread_comment_timestamp").data("timestamp") * 1000),
text: $commentContent.text(),
html: $commentContent.html()
text: $commentContent.text().trim(),
html: $commentContent.html().trim()
}
}).get();