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

Allow customizing title to add HTML without breaking meta tags #794

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

nonprofittechy
Copy link
Contributor

While trying to help a developer customize the logo in the top left of the register/sign-in page, we were getting the logo tripled.

After digging through docassemble_webapp/docassemble/webapp/templates/base_templates/base.html it appears that the register page title overrides page_title which in turn is used to customize <meta itemprop="name"..., <meta name="twitter:..., and <meta name="og:title"...>, but there is no escaping done to remove HTML.

It seems that while page_title is fine to have HTML, these specific places it is doubled-up shouldn't get nested HTML. If the included HTML in ... page title configuration includes quotes, the HTML is broken and doesn't render properly.

This PR removes the first-level HTML and then escapes any other potentially problematic entities that might remain so the ...page title configuration can safely include HTML without breaking the dual-uses.

@jhpyle jhpyle merged commit 55e4c53 into jhpyle:master Aug 13, 2024
3 checks passed
@nonprofittechy nonprofittechy deleted the filter-html-in-meta-tags branch August 13, 2024 13:36
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.

2 participants