-
Notifications
You must be signed in to change notification settings - Fork 24
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
Ensure whitespace doesn't get trimmed when the text placeholders are replaced inside the paragraph. #446
Conversation
…replaced inside the paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - assuming _misc is not used for anything?
@@ -1488,7 +1488,6 @@ def setUp(self) -> None: | |||
self.replacement_values = [ | |||
("${VE_suit}", "Validation & Encoding"), | |||
("${VE_VE2_desc}", "You have invented a new attack against Data Validation and Encoding"), | |||
("${VE_VE2_misc'}", "Read more about this topic in OWASP's free Cheat Sheets"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the _misc never called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really testing misc it’s testing how templating is suppose to work if the template label has the wrong case, contain apostroph or the template value is surrounded with whitespace. I removed it as this functionality is not used and make the code complicated and error prone.
return v | ||
elif el_text.strip().lower() == k2.lower(): | ||
return v2 | ||
elif convert_vars.making_template: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code allowed templates to be created in the first place - it's probably no longer required and it exists in the git history if we ever need it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would not automaticly build templates. Keep in mind that we are talking about idml templates here, not yaml or docx
Ensure whitespace doesn't get trimmed when the text placeholders are replaced inside the paragraph.
In this pull-request:
I found some complicated code related to the replacing the text placeholders correctly even if the case was wrong. Very considerate, but it added a lot of complexity that didn't really take away the need for doing QA so I removed it. (only used for the idml files btw.)
owasp_cornucopia_ecommerce_cards_en_1.30_leaflet.pdf
owasp_cornucopia_ecommerce_cards_en_1.30_static.pdf