diff --git a/CHANGELOG.md b/CHANGELOG.md index dbb6317..b7ce915 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ Fixes: Fix handling tab when removing trailing whitespace, especially in connection with ATX headers. + - [#251](https://github.com/mity/md4c/issues/251): + Fix handling of allowed non-alphanumeric characters in URL detection. + ## Version 0.5.2 diff --git a/src/md4c.c b/src/md4c.c index 91ada64..3e73594 100644 --- a/src/md4c.c +++ b/src/md4c.c @@ -3978,9 +3978,9 @@ md_analyze_permissive_autolink(MD_CTX* ctx, int mark_index) } else if(end < line_end && ISANYOF(end, URL_MAP[i].allowed_nonalnum_chars) && md_scan_right_for_resolved_mark(ctx, right_cursor, end, &right_cursor) == NULL && - ((end > line_beg && (ISALNUM(end-1) + ((end > line_beg && (ISALNUM(end-1) || ISANYOF(end-1, URL_MAP[i].allowed_nonalnum_chars) || CH(end-1) == _T(')'))) || CH(end) == _T('(')) && - ((end+1 < line_end && (ISALNUM(end+1) + ((end+1 < line_end && (ISALNUM(end+1) || ISANYOF(end+1, URL_MAP[i].allowed_nonalnum_chars) || CH(end+1) == _T('('))) || CH(end) == _T(')'))) { if(CH(end) == URL_MAP[i].delim_char)