ajayyy / DeArrow

Crowdsourcing better titles and thumbnails on YouTube
https://dearrow.ajay.app
GNU General Public License v3.0
1.41k stars 38 forks source link

Cannot insert ">" (Greater than) character in titles #63

Closed RustyNova016 closed 1 year ago

RustyNova016 commented 1 year ago

I've come over a particular edge case on a video where the author discuss about &Option<T>and Option<&T> from Rust: https://www.youtube.com/watch?v=6c7pZYP_iIE

The original title is "Choose the right option" which can be misinterpreted for being a philosophical or casual video instead of a programming one. And more, the video itself is biased toward Option<&T>. So I thought that "Prefer using Option<&T> over &Option" is a better title for it.

However, the ">" character isn't showing up, and I think this should be fixed, or try to add an escape character to prevent html insertion

ajayyy commented 1 year ago

We actually use greater than as a special character indicating that a word should not be have its formatting changed (>word). We chose this because YouTube official titles can't have greater than sign either.

It should be more clear in the UI though.

DivineWinds commented 1 year ago

Using confusable characters like ˂˃ (U+02C2, U+02C3) is always an option. They are even allowed in official titles.

ajayyy commented 1 year ago

Another option would be to allow \>, which would become >. Still would need a better way to indicate that to the submitter.

DivineWinds commented 1 year ago

To be fair anything would be better than the current situation where the extension effectively lifts the restriction YT placed on angle brackets... but only for the left one.

DivineWinds commented 1 year ago

Another option would be to allow \>, which would become >. Still would need a better way to indicate that to the submitter.

Just make sure we will be able to use literal \> in titles without needing zero-width spaces or something.

EDIT: Well, I just realised I was completely wrong about this one. Even if \\ is not an escape sequence we still get \\> -> \>. The case in which the \\ escape sequence would be required is if we want a backslash directly before a word with disabled formatting, that is: \\>word1 word2 -> \word1 Word2. Writing \> is still possible (\\\>), so nothing should break.

EDIT2: Actually, forget about the backslashes. What about using >> as an escape sequence like {{ and }} in format strings?

ajayyy commented 1 year ago

Right now > is only used at the start of a word, so another option is allowing it everywhere else. Would > at the start of the word be useful anywhere?

DivineWinds commented 1 year ago

Right now > is only used at the start of a word, so another option is allowing it everywhere else. Would > at the start of the word be useful anywhere?

Maybe on a video about greentext?

ajayyy commented 1 year ago

Went with the last solution for now since it's an easy change