Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Add support for bold, italics and strikethrough formatting #41

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

absidue
Copy link
Member

@absidue absidue commented Aug 12, 2022

Description
This pull request adds support for bold, italics and strikethrough formatting in comments. It also fixes text runs with only whitespace being turned into new lines e.g. " ".

The way this is written it should correctly format text fragments that have multiple types of formatting applied. I haven't been able to find a comment to test that though.

FreeTube PR: FreeTubeApp/FreeTube#2475

Screenshots (if appropriate)
before:
before

after:
after

Testing (for code that is not small enough to be easily understandable)
The comments under this video are a good place to test this PR (taken from this article)

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

Additional context
I know that the b, i and s tags shouldn't be used anymore but it makes this code a lot simpler, the alternative would be to pass on an array of fragments to FreeTube and let FreeTube do the formatting with CSS.

@absidue
Copy link
Member Author

absidue commented Aug 12, 2022

The CI faîlures aren't caused by this PR, looks like YouTube changed the JSON so the owner reply checks are failing.

Copy link
Contributor

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@ChunkyProgrammer ChunkyProgrammer left a comment

Choose a reason for hiding this comment

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

Looks like YouTube changed the data for when an owner replies to an account so I don't think this will merge (as the test is failing). Edit: nvm it merged, thankfully

@PrestonN PrestonN merged commit 8bf7a82 into FreeTubeApp:development Aug 16, 2022
@absidue absidue deleted the parse-formatting branch August 16, 2022 06:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants