The issue is that both labels are not being matched, hence is it not recognized as a link. To match labels, we need to normalize them (strip off leading/trailing whitespace, ...) and do a case-insensitive comparison. The unicode version of that is a bit more complex as we need to do a Unicode case folding. From the spec:
One label matches another just in case their normalized forms are equal. To normalize a label, strip off the opening and closing brackets, perform the Unicode case fold, strip leading and trailing spaces, tabs, and line endings, and collapse consecutive internal spaces, tabs, and line endings to a single space.
This PR adapts the normalize function to work with unicode labels too. Fortunately, I could rely on some libs (uutf, uucp, and uunf) and I even found a piece of code in the doc that does almost what's needed.
With that adapted normalize function, ẞ and SS are matched. The result is now a link as expected.
Input:
This is the result in master:
The issue is that both labels are not being matched, hence is it not recognized as a link. To match labels, we need to
normalize
them (strip off leading/trailing whitespace, ...) and do a case-insensitive comparison. The unicode version of that is a bit more complex as we need to do aUnicode case folding
. From the spec:This PR adapts the
normalize
function to work with unicode labels too. Fortunately, I could rely on some libs (uutf
,uucp
, anduunf
) and I even found a piece of code in the doc that does almost what's needed.With that adapted
normalize
function,ẞ
andSS
are matched. The result is now a link as expected.