Skip to content

Commit

Permalink
help: Do not allow autolinks for help center docs.
Browse files Browse the repository at this point in the history
mdxjs does not allow autolinks.
See mdx-js/mdx#1049.
We also added a linter check for the same.
Preparatory commit for zulip#30451.
  • Loading branch information
shubham-padia committed Jun 17, 2024
1 parent 7ff1227 commit dde59f9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion help/emoji-and-emoticons.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ names.

!!! tip ""

<https://emojipedia.org/> may be a helpful resource.
[https://emojipedia.org/](https://emojipedia.org/) may be a helpful resource.

{end_tabs}

Expand Down
2 changes: 1 addition & 1 deletion help/include/legacy-log-in.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1. Go to <https://selfhosting.zulip.com/serverlogin/>.
1. Go to [https://selfhosting.zulip.com/serverlogin/](https://selfhosting.zulip.com/serverlogin/).

1. Fill out the requested server information, and click **Continue**.

Expand Down
2 changes: 1 addition & 1 deletion help/linking-to-zulip-website.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ website (e.g., **Sponsors** or **Acknowledgements**).
logo](https://github.com/zulip/zulip/tree/main/static/images/logo),
preferably a **round Zulip icon** (available in `.png` and `.svg` formats).

1. Link to <https://zulip.com/>.
1. Link to [https://zulip.com/](https://zulip.com/).

2. If appropriate, add a brief description:

Expand Down
8 changes: 8 additions & 0 deletions tools/linter_lib/custom_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,14 @@
{
"pattern": r"\[(?P<url>[^\]]+)\]\((?P=url)\)",
"description": "Linkified Markdown URLs should use cleaner <http://example.com> syntax.",
"exclude": {"help/"},
},
{
"pattern": r"<http(s?)://[^>]+>",
"description": """Autolinks are not allowed in /help documentation due to the upcoming migration to mdx.
Use Linkified markdown URLs [url](url) instead.
See https://github.com/mdx-js/mdx/issues/1049 for more info.""",
"include_only": {"help/"},
},
{
"pattern": "https://zulip.readthedocs.io/en/latest/[a-zA-Z0-9]",
Expand Down

0 comments on commit dde59f9

Please sign in to comment.