changes in formatting of reddit comments

This commit is contained in:
azivner 2018-01-13 23:24:40 -05:00
parent 36f920b975
commit 5173afde82

View file

@ -150,9 +150,13 @@ async function importComments(accountName, afterId = null) {
const dateTimeStr = utils.dateStr(new Date(comment.created_utc * 1000)); const dateTimeStr = utils.dateStr(new Date(comment.created_utc * 1000));
const permaLink = 'https://reddit.com' + comment.permalink;
const noteText = const noteText =
`<p><a href="${comment.link_permalink}">${comment.link_permalink}</a></p> `<p><a href="${permaLink}">${permaLink}</a></p>
<p>author: ${comment.author}, subreddit: ${comment.subreddit}, karma: ${comment.score}, created at ${dateTimeStr}</p><p></p>` <p>author: <a href="https://reddit.com/u/${comment.author}">${comment.author}</a>,
subreddit: <a href="https://reddit.com/r/${comment.subreddit}">${comment.subreddit}</a>,
karma: ${comment.score}, created at ${dateTimeStr}</p><p></p>`
+ unescape(comment.body_html); + unescape(comment.body_html);
let parentNoteId = await getDateNoteIdForReddit(dateTimeStr, rootNoteId); let parentNoteId = await getDateNoteIdForReddit(dateTimeStr, rootNoteId);