christianselig / apollo-bugs

A public bug tracker for Apollo, an iOS Reddit app
227 stars 15 forks source link

Parentheses need to be escaped in Add Link #683

Open nk9 opened 4 years ago

nk9 commented 4 years ago

Describe the bug When you insert a link that contains a closing paren using the Add Link dialog, it’s inserted unescaped into the text. This corrupts the link and causes any text after the paren to appear outside the link in the rendered text.

To Reproduce Steps to reproduce the behavior:

  1. Copy a link with a paren, such as: https://en.wikipedia.org/wiki/Strategic_Petroleum_Reserve_(United_States)?wprov=sfti1
  2. Create a new comment.
  3. Select some text.
  4. Press the Add Link button.
  5. Press “Add Link”.

iOS version: 13.3.1 Apollo version: 1.7.4 iOS device: iPhone XS Jailbroken: No Reproducible: 100%

Expected behavior Apollo should modify links entered with Add Link to URL escape close parens with %41.

Screenshots image

image

afparsons commented 3 years ago

This seems to be a duplicate of https://github.com/christianselig/apollo-bugs/issues/1070.

I also experienced the same issue when adding a link.

iOS: 13.7 (Jailbroken, but that's irrelevant) Apollo: 1.10.3 Example hyperlink: https://en.wikipedia.org/wiki/Democrat_Party_(epithet)

Manually escaping the closing parenthesis ) with \ seemed to fix the issue. Observe:

[short text](https://en.wikipedia.org/wiki/Democrat_Party_(epithet\))

In #1070, the reporter @PartiallyTyped claims that this is an issue with Reddit itself. I have not confirmed this. I think it would be nice if Apollo automatically escaped the parenthesis to resolve this issue (in other words, proactively resolve the issue and don't wait for Reddit).


Edit: clarity