laurencedawson / sync-for-reddit

New and improved issue tracker for the app Sync for Reddit
191 stars 3 forks source link

[BUG] Wikipedia links ending in parenthesis leaves the parenthesis out of hyperlink #1705

Open Devonance opened 1 year ago

Devonance commented 1 year ago

Describe the bug
When linking a Wikipedia article (possibly other sites as well) that ends in a ")", the insert link button will leave out the ending parenthesis which results in breaking the link.

Additionally, folling a link given by a non-sync user will also result in their link leaving off the ending parenthesis. I don't believe it is the fault of the "insert link button", but the parsing of the link itself.

Link inserted as: https://en.m.wikipedia.org/wiki/Meander_(art)

But upon clicking, the browser shows it as: https://en.m.wikipedia.org/wiki/Meander_(art

Directly adding the link without the cover text will result in the link appearing normal and working.

Steps to Reproduce

  1. Go to this Comment
  2. Click on the link
  3. (Or long press the link to see the link has left out the parenthesis and added it to the cover text)
  4. See error

Expected behavior
Expected to insert clickable working link regardless of words/special characters in the link.

Screenshots
Screenshot_20230227_235552_Sync Pro Screenshot_20230227_235637_Sync Pro

Smartphone (please complete the following information):