lint: Ban Help Center relative links without leading /.

Such links would likely end up broken if we change our URL scheme to
no longer be based around URL fragments.
This commit is contained in:
Tim Abbott 2022-05-04 11:18:08 -07:00
parent 44c9b788f9
commit 25999b7056
2 changed files with 7 additions and 1 deletions

View File

@ -109,7 +109,7 @@
is_checked=realm_enable_spectator_access
label=admin_settings_label.realm_enable_spectator_access
is_disabled=disable_enable_spectator_access_setting
help_link="help/public-access-option"}}
help_link="/help/public-access-option"}}
<div class="input-group realm_create_web_public_stream_policy">
<label for="realm_create_web_public_stream_policy" class="dropdown-title">{{t "Who can create web-public streams" }}</label>
<select name="realm_create_web_public_stream_policy" id="id_realm_create_web_public_stream_policy" class="prop-element" data-setting-widget-type="number">

View File

@ -662,6 +662,12 @@ html_rules: List["Rule"] = [
"good_lines": ['<img src="{{source_url}}" alt="{{ _(name) }}" />'],
"bad_lines": ['<img alt="{{ " />'],
},
{
"pattern": r"link=\"help/",
"description": "Relative links to Help Center should start with /help/",
"good_lines": ['link="/help/foo"'],
"bad_lines": ['link="help/foo"'],
},
{
"pattern": r"\bon\w+ ?=",
"description": "Don't use inline event handlers (onclick=, etc. attributes) in HTML. Instead,"