zulip/help
Zixuan James Li 268f858f39 linkifier: Support URL templates for linkifiers.
This swaps out url_format_string from all of our APIs and replaces it
with url_template. Note that the documentation changes in the following
commits  will be squashed with this commit.

We change the "url_format" key to "url_template" for the
realm_linkifiers events in event_schema, along with updating
LinkifierDict. "url_template" is the name chosen to normalize
mixed usages of "url_format_string" and "url_format" throughout
the backend.

The markdown processor is updated to stop handling the format string
interpolation and delegate the task template expansion to the uri_template
library instead.

This change affects many test cases. We mostly just replace "%(name)s"
with "{name}", "url_format_string" with "url_template" to make sure that
they still pass. There are some test cases dedicated for testing "%"
escaping, which aren't relevant anymore and are subject to removal.
But for now we keep most of them as-is, and make sure that "%" is always
escaped since we do not use it for variable substitution any more.

Since url_format_string is not populated anymore, a migration is created
to remove this field entirely, and make url_template non-nullable since
we will always populate it. Note that it is possible to have
url_template being null after migration 0422 and before 0424, but
in practice, url_template will not be None after backfilling and the
backend now is always setting url_template.

With the removal of url_format_string, RealmFilter model will now be cleaned
with URL template checks, and the old checks for escapes are removed.

We also modified RealmFilter.clean to skip the validation when the
url_template is invalid. This avoids raising mulitple ValidationError's
when calling full_clean on a linkifier. But we might eventually want to
have a more centric approach to data validation instead of having
the same validation in both the clean method and the validator.

Fixes #23124.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-04-19 12:20:49 -07:00
..
include help: Add a dedicated page on how to format spoiler blocks. 2023-03-30 09:39:35 -07:00
add-a-bot-or-integration.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
add-a-custom-linkifier.md linkifier: Support URL templates for linkifiers. 2023-04-19 12:20:49 -07:00
add-or-remove-users-from-a-stream.md help: Document "Who can unsubscribe others from this stream?" setting. 2023-03-07 11:06:52 -08:00
all-messages.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
allow-image-link-previews.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
analytics.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
animated-gifs-from-giphy.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
archive-a-stream.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
bots-and-integrations.md web: Save a needless 301 redirect from /integrations to /integrations/. 2023-03-24 14:51:01 -07:00
browse-and-subscribe-to-streams.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
bulleted-and-numbered-lists.md help: Add a dedicated page on how to format lists. 2023-03-24 15:19:08 -07:00
change-a-users-name.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-a-users-role.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-organization-url.md web: Save a needless 301 redirect from /integrations to /integrations/. 2023-03-24 14:51:01 -07:00
change-the-color-of-a-stream.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-the-privacy-of-a-stream.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-the-stream-description.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-the-time-format.md display_settings: Rename and update the 'language-time' section. 2023-03-09 16:12:45 -08:00
change-your-email-address.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-your-language.md display_settings: Rename and update the 'language-time' section. 2023-03-09 16:12:45 -08:00
change-your-name.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-your-password.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-your-profile-picture.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
change-your-timezone.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
code-blocks.md help: Update Message formatting section and page on code blocks. 2023-03-30 09:39:35 -07:00
collapse-a-message.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
communities-directory.md help center: Document supporting Zulip and linking to the Zulip website. 2023-01-26 10:59:23 -08:00
configure-authentication-methods.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
configure-default-new-user-settings.md docs: Update time format and Emoticon help page. 2023-03-09 16:12:45 -08:00
configure-default-view.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
configure-email-visibility.md help: Document modifying email visibility on sign-up. 2023-02-24 09:30:32 -08:00
configure-emoticon-translations.md docs: Update time format and Emoticon help page. 2023-03-09 16:12:45 -08:00
configure-how-links-open.md help: Move "Configure how links open" to the Apps section. 2023-03-09 16:11:51 -08:00
configure-multi-language-search.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
configure-notification-bot.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
configure-organization-language.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
configure-who-can-create-streams.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
configure-who-can-invite-to-streams.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
connect-through-a-proxy.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
contact-support.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
create-a-poll.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
create-a-stream.md help: Document "Who can unsubscribe others from this stream?" setting. 2023-03-07 11:06:52 -08:00
create-streams.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
create-user-groups.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
create-your-organization-profile.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
custom-certificates.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
custom-emoji.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
custom-profile-fields.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
customize-organization-settings.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
customize-settings-for-new-users.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
dark-theme.md display_settings: Rename and reorder the theme dropdown menu. 2023-03-09 16:12:45 -08:00
deactivate-or-reactivate-a-bot.md help: Move "Admins only" banner in "Deactivate/reactivate a bot". 2023-01-26 10:18:25 -08:00
deactivate-or-reactivate-a-user.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
deactivate-your-account.md help: Improve "Deactivate your account" help page. 2023-03-15 15:32:47 -07:00
deactivate-your-organization.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
delete-a-topic.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
demo-organizations.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
desktop-app-install-guide.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
desktop-notifications.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
digest-emails.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
direct-messages.md help: Update "Private messages" -> "Direct messages". 2023-02-28 16:55:13 -08:00
disable-message-edit-history.md help: Update URLs to match "Restrict message editing and deletion" title. 2023-02-10 15:56:16 -08:00
disable-welcome-emails.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
dm-mention-alert-notifications.md help: Clarify alert words documentation. 2023-03-21 15:49:16 -07:00
do-not-disturb.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
edit-a-bot.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
edit-or-delete-a-message.md help: Update URLs to match "Restrict message editing and deletion" title. 2023-02-10 15:56:16 -08:00
edit-your-profile.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
email-notifications.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
emoji-and-emoticons.md docs: Update time format and Emoticon help page. 2023-03-09 16:12:45 -08:00
emoji-reactions.md help: Add tip about `+` keyboard shortcut to "Emoji reactions" page. 2023-03-24 12:58:35 -07:00
enable-full-width-display.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
export-your-organization.md help: Improve and extend "Export your oganization" documentation. 2023-03-22 11:56:14 -07:00
finding-a-topic-to-read.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
format-a-quote.md help: Add a dedicated page on how to format quotes. 2023-03-30 09:39:35 -07:00
format-your-message-using-markdown.md help: Add a dedicated page on how to format spoiler blocks. 2023-03-30 09:39:35 -07:00
gdpr-compliance.md web: Save two 301 redirects from /privacy to /privacy/ to /policies/privacy. 2023-03-24 14:51:01 -07:00
getting-started-with-zulip.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
getting-your-organization-started-with-zulip.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
hide-message-content-in-emails.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
high-contrast-mode.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
import-from-gitter.md web: Save a needless 301 redirect from /integrations to /integrations/. 2023-03-24 14:51:01 -07:00
import-from-mattermost.md help: Fix import-self-hosted-server-tips indentation. 2023-03-18 00:09:43 -07:00
import-from-rocketchat.md help: Fix import-self-hosted-server-tips indentation. 2023-03-18 00:09:43 -07:00
import-from-slack.md help: Fix import-self-hosted-server-tips indentation. 2023-03-18 00:09:43 -07:00
import-your-settings.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
index.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
insert-a-link.md help: Add a dedicated page on how to format links. 2023-03-30 09:39:35 -07:00
invite-new-users.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
invite-users-to-join.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
join-a-zulip-organization.md web: Save a needless 301 redirect from /apps to /apps/. 2023-03-24 14:51:01 -07:00
keyboard-shortcuts.md help: Document `=` keyboard shortcut. 2023-03-24 12:58:35 -07:00
latex.md help: Add a dedicated page on how to format LaTeX. 2023-03-30 09:39:35 -07:00
link-to-a-message-or-conversation.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
linking-to-zulip-website.md help center: Document supporting Zulip and linking to the Zulip website. 2023-01-26 10:59:23 -08:00
linking-to-zulip.md help center: Document supporting Zulip and linking to the Zulip website. 2023-01-26 10:59:23 -08:00
logging-in.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
logging-out.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
manage-inactive-streams.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
manage-user-stream-subscriptions.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
manage-your-uploaded-files.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
marking-messages-as-read.md help: Document mark messages as read via recent conversations. 2023-03-24 12:09:58 -07:00
marking-messages-as-unread.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
mastering-the-compose-box.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
mention-a-user-or-group.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
message-a-stream-by-email.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
message-actions.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
message-retention-policy.md web: Save a needless 301 redirect from /plans to /plans/. 2023-03-24 14:51:01 -07:00
messaging-tips.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
migrating-from-other-chat-tools.md web: Save a 301 redirect from /self-hosting to /self-hosting/. 2023-03-24 14:51:01 -07:00
missing.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
mobile-notifications.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
moderating-open-organizations.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
move-content-to-another-stream.md help: Update URLs to match "Restrict moving messages" title. 2023-02-10 15:56:16 -08:00
move-content-to-another-topic.md help: Update URLs to match "Restrict moving messages" title. 2023-02-10 15:56:16 -08:00
mute-a-stream.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
mute-a-topic.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
mute-a-user.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
open-the-compose-box.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
organization-type.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
pin-a-stream.md help center: Update "Mute a stream" and "Pin a stream" pages. 2023-01-26 10:32:47 -08:00
preview-your-message-before-sending.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
public-access-option.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
quote-and-reply.md help: Add a dedicated page on how to format quotes. 2023-03-30 09:39:35 -07:00
read-receipts.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
reading-dms.md help: Update "Reading private messages" -> "Reading direct messages". 2023-02-28 16:55:13 -08:00
reading-strategies.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
reading-topics.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
recent-conversations.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
rename-a-stream.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
rename-a-topic.md help: Update URLs to match "Restrict moving messages" title. 2023-02-10 15:56:16 -08:00
replying-to-messages.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
request-an-integration.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
require-topics.md help: Update URLs to match "Restrict moving messages" title. 2023-02-10 15:56:16 -08:00
resize-the-compose-box.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
resolve-a-topic.md web: Save a needless 301 redirect from /integrations to /integrations/. 2023-03-24 14:51:01 -07:00
restrict-account-creation.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
restrict-bot-creation.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
restrict-direct-messages.md help: Update "Restrict private messages" -> "Restrict direct messages". 2023-02-28 16:55:13 -08:00
restrict-message-editing-and-deletion.md help: Update URLs to match "Restrict moving messages" title. 2023-02-10 15:56:16 -08:00
restrict-moving-messages.md help: Update URLs to match "Restrict moving messages" title. 2023-02-10 15:56:16 -08:00
restrict-name-and-email-changes.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
restrict-permissions-of-new-members.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
restrict-profile-picture-changes.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
restrict-wildcard-mentions.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
review-your-organization-settings.md help center: Update relative gear menu macro for organization settings. 2023-01-26 10:17:45 -08:00
review-your-settings.md help: Add section on privacy settings to /help/review-your-settings. 2023-02-23 11:48:32 -08:00
roles-and-permissions.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
saml-authentication.md help center: Document SAML configuration steps with Auth0. 2023-03-30 09:11:55 -07:00
scim.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
search-for-messages.md help: Clarify alert words documentation. 2023-03-21 15:49:16 -07:00
set-default-streams-for-new-users.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
set-up-integrations.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
set-up-your-account.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
setting-up-zulip-for-a-class.md web: Save a needless 301 redirect from /integrations to /integrations/. 2023-03-24 14:51:01 -07:00
share-and-upload-files.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
spoilers.md help: Add a dedicated page on how to format spoiler blocks. 2023-03-30 09:39:35 -07:00
star-a-message.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
start-a-call.md help: Fix link to production docs in "Start a call" page. 2023-03-23 12:18:06 -07:00
start-a-new-topic.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
starting-a-new-private-thread.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
starting-a-new-topic.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
status-and-availability.md help: Add instructions for viewing status. 2023-03-09 16:14:14 -08:00
stream-notifications.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
stream-permissions.md stream_privacy: Use new lock and hashtag icons. 2023-04-10 23:41:30 -07:00
stream-sending-policy.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
streams-and-topics.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
support-zulip-project.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
supported-browsers.md help: Drop outdated "Zulip in a terminal" help page. 2023-03-07 15:03:49 -08:00
switching-between-organizations.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
text-emphasis.md help: Add a dedicated page on how to add emphasis to text. 2023-03-16 10:51:57 -07:00
trying-out-zulip.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
typing-notifications.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
unsubscribe-from-a-stream.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
user-cards.md help: Update URL references to new "Configure email visibility" page. 2023-02-10 18:15:56 -08:00
user-groups.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
using-zulip-for-a-class.md web: Save a 301 redirect from /for/x to /for/x/. 2023-03-24 14:51:01 -07:00
using-zulip-via-email.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
verify-your-message-was-successfully-sent.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
view-a-messages-edit-history.md help: Update URLs to match "Restrict message editing and deletion" title. 2023-02-10 15:56:16 -08:00
view-all-bots-in-your-organization.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
view-and-browse-images.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
view-and-edit-your-message-drafts.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
view-messages-sent-by-a-user.md help: Update "private message" -> "direct message" term. 2023-02-28 16:55:13 -08:00
view-someones-profile.md help: Add instructions for viewing status. 2023-03-09 16:14:14 -08:00
view-the-exact-time-a-message-was-sent.md docs: Update time format and Emoticon help page. 2023-03-09 16:12:45 -08:00
view-the-markdown-source-of-a-message.md help-docs: Move help center documentation to top level directory. 2023-01-25 14:08:29 -08:00
view-your-mentions.md help: Update filenames "private message" -> "direct message". 2023-02-28 16:55:13 -08:00
view-zulip-version.md help: Fix links to production docs. 2023-03-23 12:18:06 -07:00
zulip-cloud-billing.md web: Save a needless 301 redirect from /plans to /plans/. 2023-03-24 14:51:01 -07:00
zulip-cloud-or-self-hosting.md web: Save a 301 redirect from /self-hosting to /self-hosting/. 2023-03-24 14:51:01 -07:00