Allow customizing title to add HTML without breaking meta tags #794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theregister page title
overridespage_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.