diff --git a/static/templates/settings/playground_settings_admin.hbs b/static/templates/settings/playground_settings_admin.hbs index abbee693b4..dfce1f68a9 100644 --- a/static/templates/settings/playground_settings_admin.hbs +++ b/static/templates/settings/playground_settings_admin.hbs @@ -18,7 +18,7 @@

{{#if is_admin}} diff --git a/templates/corporate/jobs.html b/templates/corporate/jobs.html index 5a368203ef..922e70077d 100644 --- a/templates/corporate/jobs.html +++ b/templates/corporate/jobs.html @@ -49,7 +49,7 @@ How we work

- Open source. The Zulip software is 100% free and + Open source. The Zulip software is 100% free and open source. We're an open-source project first, and we’re building a sustainable business as a means to support the project's growth and long-term future. We provide the same open-source @@ -77,7 +77,7 @@ are open to all applicants without regard for location.

- Maintainable software. Great + Maintainable software. Great software over time depends on a team’s shared understanding of a system and how to change it, as much as on the code itself. Beyond writing our diff --git a/templates/corporate/upgrade.html b/templates/corporate/upgrade.html index 3910afd4d4..95a299fb71 100644 --- a/templates/corporate/upgrade.html +++ b/templates/corporate/upgrade.html @@ -49,7 +49,7 @@ {% endif %} {% if onboarding and free_trial_days %} -

Not ready to start your trial? Continue with the Zulip Cloud Free plan.

+

Not ready to start your trial? Continue with the Zulip Cloud Free plan.


Zulip Standard free trial

{% endif %} @@ -165,7 +165,7 @@
{% if onboarding and free_trial_days %} -

Not ready to start your trial? Continue with the Zulip Cloud Free plan.

+

Not ready to start your trial? Continue with the Zulip Cloud Free plan.


Zulip Standard free trial

{% endif %} diff --git a/templates/zerver/development/integrations_dev_panel.html b/templates/zerver/development/integrations_dev_panel.html index 76fde940d6..7496fe0426 100644 --- a/templates/zerver/development/integrations_dev_panel.html +++ b/templates/zerver/development/integrations_dev_panel.html @@ -70,7 +70,7 @@
- +
diff --git a/templates/zerver/emails/confirm_new_email.source.html b/templates/zerver/emails/confirm_new_email.source.html index dfd4c3adc5..4f055da92f 100644 --- a/templates/zerver/emails/confirm_new_email.source.html +++ b/templates/zerver/emails/confirm_new_email.source.html @@ -10,5 +10,5 @@

{% trans realm_uri=macros.link_tag(realm_uri), old_email=macros.email_tag(old_email), new_email=macros.email_tag(new_email) %}We received a request to change the email address for the Zulip account on {{ realm_uri }} from {{ old_email }} to {{ new_email }}. To confirm this change, please click below:{% endtrans %} {{_('Confirm email change') }}

-

{% trans support_email=macros.email_tag(support_email) %}If you did not request this change, please contact us immediately at {{ support_email }}.{% endtrans %}

+

{% trans support_email=macros.email_tag(support_email) %}If you did not request this change, please contact us immediately at {{ support_email }}.{% endtrans %}

{% endblock %} diff --git a/templates/zerver/login.html b/templates/zerver/login.html index 86de0c4a10..0b0fc8a333 100644 --- a/templates/zerver/login.html +++ b/templates/zerver/login.html @@ -135,7 +135,7 @@ page can be easily identified in it's respective JavaScript file. -->
diff --git a/tools/lib/template_parser.py b/tools/lib/template_parser.py index e564188c64..adb10fe8cc 100644 --- a/tools/lib/template_parser.py +++ b/tools/lib/template_parser.py @@ -290,6 +290,7 @@ def validate(fn: Optional[str] = None, text: Optional[str] = None) -> None: {e}""" ) + prevent_whitespace_violations(fn, tokens) prevent_dangling_tags(fn, tokens) class State: @@ -435,6 +436,38 @@ def validate(fn: Optional[str] = None, text: Optional[str] = None) -> None: raise TemplateParserException("Missing end tag") +def prevent_whitespace_violations(fn: str, tokens: List[Token]) -> None: + if tokens[0].kind in ("indent", "whitespace"): + raise TemplateParserException(f" Please remove the whitespace at the beginning of {fn}.") + + for i in range(1, len(tokens) - 1): + token = tokens[i] + next_token = tokens[i + 1] + + if token.kind == "indent": + if next_token.kind in ("indent", "whitespace"): + raise AssertionError("programming error parsing indents") + + if next_token.kind == "newline": + raise TemplateParserException( + f"""Please just make row {token.line} in {fn} a truly blank line (no spaces).""" + ) + + if token.kind == "whitespace": + if len(token.s) > 1: + raise TemplateParserException( + f""" + We did not expect this much whitespace at row {token.line} column {token.col} in {fn}. + """ + ) + if next_token.kind == "newline": + raise TemplateParserException( + f""" + Unexpected trailing whitespace at row {token.line} column {token.col} in {fn}. + """ + ) + + def prevent_dangling_tags(fn: str, tokens: List[Token]) -> None: """ Prevent this kind of HTML: