Don't linkify links that might affect Markdown.

This commit is contained in:
Fox2Code 2022-02-04 21:54:21 +01:00
parent 73201e467b
commit 01292ac938

View File

@ -22,7 +22,9 @@ public class MarkdownUrlLinker {
'\n' == url.charAt(index - 1) || '\n' == url.charAt(index - 1) ||
' ' == url.charAt(index - 1)) { ' ' == url.charAt(index - 1)) {
int endDomain = url.indexOf('/', index + 9); int endDomain = url.indexOf('/', index + 9);
if (endDomain != -1 && endDomain < end) { char endCh = url.charAt(end - 1);
if (endDomain != -1 && endDomain < end &&
endCh != '>' && endCh != ')' && endCh != ']') {
linkifyTasks.add(new LinkifyTask(index, end)); linkifyTasks.add(new LinkifyTask(index, end));
extra += (end - index) + 4; extra += (end - index) + 4;
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {