Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Cell: Fix detection of markdown links
The current regex of markdown link would purposely discard any `[label](link)` combination for which the label contained an opening bracket `[`, the reason behind it was to reject strings for which the label itself contained a markdown link as the markdown spec [1] specifies that we capture square brackets immediately followed by parenthesis. However, we should still support a label that contains closed square brackets (e.g. `[Label has [brackets]](link)`. Applying the proper rule to detect an exact link would be more costy than the current regex and considering that it will be called on all evaluated cell when reevaluated. Since the current regex is too restrictive, this revision relaxes it with the downside that it will now also capture strings that are technically not exact markdown links but better have false positive than false negatives. The regex also becomes simpler. [1] https://spec-md.com/#sec-Links closes #3435 Task: 3628780 X-original-commit: a93f0cd Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
- Loading branch information