Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode brackets in URI to avoid conflict with markdown links. #12583

Closed
wants to merge 1 commit into from

Conversation

tommyip
Copy link
Member

@tommyip tommyip commented Jun 15, 2019

This works for brackets in both stream and topic names.

Fixes #12579.

@zulipbot
Copy link
Member

Hello @zulip/server-markdown, @zulip/server-message-view members, this pull request was labeled with the "area: markdown", "area: message view" labels, so you may want to check it out!

@timabbott
Copy link
Sponsor Member

A couple requests:
(1) Can you add a test for this?
(2) Are we confident that's the only syntax we need to encode? I'm wondering a bit whether we want to just do general URL-encoding here.

@tommyip
Copy link
Member Author

tommyip commented Jun 16, 2019

@timabbott the link is already URL encoded, see hash_util.by_conversation_and_time_uri. We need to encode brackets here since they are valid URL symbols, but interferes with the markdown syntax.

I will add the tests.

@zulipbot zulipbot added size: L and removed size: S labels Jun 16, 2019
@tommyip tommyip changed the title ClipboardJS: Encode brackets in URI to avoid conflict with markdown links. Encode brackets in URI to avoid conflict with markdown links. Jun 16, 2019
@tommyip
Copy link
Member Author

tommyip commented Jun 16, 2019

Added test. Also moved the encoding code out of the ClipboardJS constructor for easier testing.

@timabbott
Copy link
Sponsor Member

Awesome, merged, thanks @tommyip!

@timabbott timabbott closed this Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parentheses () in topic name not encoded when using "Copy link to conversation"
3 participants