Ensure that links containing )) still render and work correctly

:information_source: Overview

Discourse does not properly render links when they contain double close parentheses — )) — which means these links don’t work properly when added directly or when pasted over text to create an automatic text link.

:walking_woman: Steps to reproduce

  1. Create a link that contains )) somewhere in the middle of the URL. For example, meta.discourse.org/?parameter_one=((value))&parameter_two=value.
  2. Paste this into the composer, as-is.
  3. Paste the same URL over text to create an automatic text link.

:white_check_mark: Expected results

The original link should render and function correctly in both cases.

:x: Observed results

The link functionality cuts off at the )) and the rest of the URL is dropped.

Examples:

:books: Additional context

When pasting a link directly, encoding the double close parentheses as %29) may work, as well as encapsulating the URL in <> when pasting over text. Examples:

3 Likes

I don’t think we can fix this @lindsey this is a behavior in markdown-it, and more exactly in the underlying linkify library.

You can test this behavior here: linkify-it demo

Themselves have an open issue for more than 8 years on the subject: Better handle nested parens · Issue #23 · markdown-it/linkify-it · GitHub

4 Likes

@Vitaly thoughts? Should we be forking linkify to fix this or wait for upstream? Can we contract you to fix this issue?