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

Make sure to normalize subtags when parsing BBCode #75622

Conversation

joao-pedro-braz
Copy link
Contributor

This PR makes it so that all subtags are normalized before usage. Normalization means removing any leading and/or trailing quotation marks from any given subtag.

Fixes: #75501

image

@joao-pedro-braz joao-pedro-braz requested a review from a team as a code owner April 3, 2023 17:06
@joao-pedro-braz
Copy link
Contributor Author

A nice followup would be adding some tests for the parser.
There are so many little things that could break during parsing, that it would be a nightmare to debug.
Not saying that the current parser is bad, not all, just that it's complex enough to warrant unit tests.

@YuriSizov YuriSizov added this to the 4.1 milestone Apr 3, 2023
@joao-pedro-braz joao-pedro-braz force-pushed the parse_string_paths_with_quotes_correctly_bb_code branch from 6435b86 to fadde9f Compare May 7, 2023 02:07
@joao-pedro-braz
Copy link
Contributor Author

Sorry it took me so long to address your points @KoBeWi, Github decided to just not notify me of them 🤡

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

I think color and outline_color also need unquote, because they don't work quoted.

Other than that seems fine (I don't know if it covers all cases though).

@akien-mga akien-mga requested a review from bruvzg May 22, 2023 11:39
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

I think color and outline_color also need unquote, because they don't work quoted.

Indeed, it should be unquoted as well (both main tags and drop cap subtags). Quoted colors won't work, at least in case of HTML color codes.

Otherwise, seems OK.

@joao-pedro-braz
Copy link
Contributor Author

I think color and outline_color also need unquote, because they don't work quoted.

Other than that seems fine (I don't know if it covers all cases though).

Weird... I would guess they would work, I'll have a look

This PR makes it so that all subtags are normalized before usage.
Normalization means removing any leading and/or trailing quotation marks
from any given subtag.

Fixes: godotengine#75501
@joao-pedro-braz
Copy link
Contributor Author

image
Fixed!

@joao-pedro-braz joao-pedro-braz force-pushed the parse_string_paths_with_quotes_correctly_bb_code branch from fadde9f to 8b6e572 Compare May 23, 2023 21:55
@akien-mga akien-mga merged commit a105831 into godotengine:master May 24, 2023
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants