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

Add support for bold, italics and strikethrough formatting in comments #2475

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

absidue
Copy link
Member

@absidue absidue commented Aug 12, 2022


Add support for bold, italics and strikethrough formatting in comments

Pull Request Type

  • Feature Implementation

Related issue
closes #2404
yt-comment-scraper PR: FreeTubeApp/yt-comment-scraper#41

Description
The majority of the changes are in yt-comment-scraper, this PR purely adds support for the yt-comment-scraper changes.

This pull request adds support for bold, italics and strikethrough formatting in comments.

Screenshots (if appropriate)
before:
before

after:
after

Testing (for code that is not small enough to be easily understandable)

  1. Install the yt-comment-scraper PR: yarn add "@freetube/yt-comment-scraper@git+https://github.com/absidue/yt-comment-scraper#parse-formatting"
  2. The comments under this video are a good place to test this PR (taken from this article)

https://www.youtube.com/watch?v=OqiXFXlYFi8

Desktop (please complete the following information):

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.17.1

@PikachuEXE
Copy link
Collaborator

Tested locally but test instruction incorrect
Wrong: yarn add "yt-comment-scraper@git+https://github.com/absidue/yt-comment-scraper#parse-formatting"
Right: yarn add "@freetube/yt-comment-scraper@git+https://github.com/absidue/yt-comment-scraper#parse-formatting"

image
image

@absidue
Copy link
Member Author

absidue commented Aug 13, 2022

Oops, sorry for that.

Edit: fixed the instructions now

@PrestonN PrestonN merged commit 3e07114 into FreeTubeApp:development Aug 16, 2022
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 16, 2022
@ChunkyProgrammer
Copy link
Member

I'm guessing this isn't supported by invidious

@absidue absidue deleted the comment-formatting branch August 16, 2022 12:50
@absidue
Copy link
Member Author

absidue commented Aug 16, 2022

@ChunkyProgrammer So we can do it for Invidious but it will only be for bold and italicised text as they don't seem to be parsing strikethrough on their end. Currently we use content, the problem is that Invidious also returns links in their contentHtml property so we would need much more complicated regex to filter that out.

content: This text will be bold and this will be italicized and this will will be crossed out
contentHtml: <b>This text will be bold</b> and <i>this will be italicized</i> and this will will be crossed out

Preview:
This text will be bold and this will be italicized and this will will be crossed out

Local API for comparison:

<b>This text will be bold</b> and <i>this will be italicized</i> and <s>this will will be crossed out</s>

Preview:
This text will be bold and this will be italicized and this will will be crossed out

@absidue absidue mentioned this pull request Aug 31, 2022
1 task
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.

[Bug]: Local API comments not rendering strikethroughs
5 participants