Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS: Fix snippet generation for parent comment #1643

Merged
merged 2 commits into from
Jul 4, 2023
Merged

RSS: Fix snippet generation for parent comment #1643

merged 2 commits into from
Jul 4, 2023

Conversation

koteyur
Copy link
Contributor

@koteyur koteyur commented Jun 12, 2023

PR fixes the following issues with snippet generation for parent comments in RSS (couldn't find existing issues to tag them...):

  1. Current implementation simply removes the last word, without truncating up to limit length.
  2. In case if even the first word (e.g. magnet link or some base64) is too long don't add extra space.

STR:

  1. Run dev version (https://remark42.com/docs/contributing/backend/)
  2. Write very long comment (chatgpt helps :))
  3. Reply to the comment
  4. Check RSS

ER:
Text of original comment in reply item is truncated to 300 chars.

AR:
Only the last word is truncated.

1) Current implementation simply removes the last word, without truncating up to limit length.
2) In case if even the first word (magnet link or some base64?) is too long don't add extra space.
@koteyur koteyur requested a review from umputun as a code owner June 12, 2023 22:48
@koteyur koteyur changed the title Fix snippet generation RSS: Fix snippet generation for parent comment Jun 22, 2023
@umputun umputun requested a review from paskal June 25, 2023 00:35
paskal
paskal previously approved these changes Jun 29, 2023
Copy link
Sponsor Collaborator

@paskal paskal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@koteyur
Copy link
Contributor Author

koteyur commented Jun 29, 2023

It looks like new version of golangci-lint found some issues in existing code:

  Error: httpNoBody: http.NoBody should be preferred to the nil request body (gocritic)
  Error: httpNoBody: http.NoBody should be preferred to the nil request body (gocritic)
  Error: httpNoBody: http.NoBody should be preferred to the nil request body (gocritic)

@koteyur koteyur requested a review from paskal June 30, 2023 06:37
Copy link
Owner

@umputun umputun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx

@umputun umputun merged commit add0145 into umputun:master Jul 4, 2023
1 check passed
@paskal paskal added this to the v1.12.0 milestone Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants