From a98363fe362931a7caf82bd8ce62ab0b1f9f5e9b Mon Sep 17 00:00:00 2001 From: Shubham Padia Date: Mon, 17 Jun 2024 14:03:36 +0000 Subject: [PATCH] help: Do not allow autolinks for help center docs. mdxjs does not allow autolinks. See https://github.com/mdx-js/mdx/issues/1049. We also added a linter check for the same. Preparatory commit for #30451. --- help/emoji-and-emoticons.md | 2 +- help/include/legacy-log-in.md | 2 +- help/linking-to-zulip-website.md | 2 +- tools/linter_lib/custom_check.py | 8 ++++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/help/emoji-and-emoticons.md b/help/emoji-and-emoticons.md index 78d731816d..d963e738e4 100644 --- a/help/emoji-and-emoticons.md +++ b/help/emoji-and-emoticons.md @@ -132,7 +132,7 @@ names. !!! tip "" - may be a helpful resource. + [https://emojipedia.org/](https://emojipedia.org/) may be a helpful resource. {end_tabs} diff --git a/help/include/legacy-log-in.md b/help/include/legacy-log-in.md index fc6dbbe337..2e62616234 100644 --- a/help/include/legacy-log-in.md +++ b/help/include/legacy-log-in.md @@ -1,4 +1,4 @@ -1. Go to . +1. Go to [https://selfhosting.zulip.com/serverlogin/](https://selfhosting.zulip.com/serverlogin/). 1. Fill out the requested server information, and click **Continue**. diff --git a/help/linking-to-zulip-website.md b/help/linking-to-zulip-website.md index 763e2bce55..00b0c7d8b5 100644 --- a/help/linking-to-zulip-website.md +++ b/help/linking-to-zulip-website.md @@ -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 . +1. Link to [https://zulip.com/](https://zulip.com/). 2. If appropriate, add a brief description: diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 61d3510977..7cf1cec6bc 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -839,6 +839,14 @@ markdown_rules = RuleList( { "pattern": r"\[(?P[^\]]+)\]\((?P=url)\)", "description": "Linkified Markdown URLs should use cleaner syntax.", + "exclude": {"help/"}, + }, + { + "pattern": r"]+>", + "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]",