HomePhorge

Try to make intelligent decisions when deciding if parens should be stripped…

Description

Try to make intelligent decisions when deciding if parens should be stripped before linking

This logic is torture and needs some rework.

Rules:

  • Always strip leading (, as it can't be part of a URL
  • Short circuit to only strip leading if no trailing
  • If valid email address when trailing ) stripped, we can strip trailing )
  • If not even a valid URL without trailing ), short circuit to only strip leading
  • If query parameters detected, strip trailing. It should have been encoded as %29.
  • If there isn't a / the trailing ) can't be part of the URL, strip trailing.
  • If there isn't at least one ( in the URI.path, only strip leading. Assume ) is not part of the URL.
  • If we have an equal count of ( and ) chars with the leading ( already stripped, only strip leading

Details

Provenance
Mark FelderAuthored on Jan 26 2021, 4:30 PM
Parents
R19:bd7a75991101: Merge branch 'release/0.4.1' into 'master'
Branches
Unknown
Tags
Unknown

Event Timeline