fix: count parentheses in links (#5515)

This commit is contained in:
nerix
2024-07-21 16:00:12 +02:00
committed by GitHub
parent 5deec1f02f
commit 847e4f0932
4 changed files with 60 additions and 11 deletions
+3 -2
View File
@@ -16,8 +16,9 @@ namespace chatterino::linkparser {
///
/// Prefixes and suffixes are almost identical to the ones in GitHub Flavored
/// Markdown (GFM - https://github.github.com/gfm/#autolinks-extension-).
/// The main differences are that '_' isn't a valid suffix and parentheses
/// aren't counted (e.g. "(a.com/(foo)! would result in "a.com/(foo").
/// The main difference is that '_' isn't a valid suffix.
/// Parentheses are counted inside the @a rest: parsing "(a.com/(foo))" would
/// result in the link "a.com/(foo)".
/// Matching is done case insensitive (e.g. "HTTp://a.com" would be valid).
///
/// A @a protocol can either be empty, "http://", or "https://".