Skip to content

Commit

Permalink
\ for Hyperlink Canceling works!
Browse files Browse the repository at this point in the history
  • Loading branch information
MeAlam1 committed Dec 11, 2024
1 parent 6db5fc2 commit bcfe079
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,20 @@ private void processComponentText(String text, MutableComponent result, Pattern
int lastIndex = 0;

while (matcher.find()) {
appendUnstyledText(text.substring(lastIndex, matcher.start()), result);
appendHyperlink(matcher.group(1), matcher.group(2), result);
if (matcher.start() > 0 && text.charAt(matcher.start() - 1) == '\\') {
appendUnstyledText(text.substring(lastIndex, matcher.start() - 1), result);
appendUnstyledText(matcher.group(0), result);
} else {
appendUnstyledText(text.substring(lastIndex, matcher.start()), result);
appendHyperlink(matcher.group(1), matcher.group(2), result);
}
lastIndex = matcher.end();
}

appendUnstyledText(text.substring(lastIndex), result);
}


private MutableComponent processSiblings(MutableComponent pComponent, Pattern pattern) {
MutableComponent result = Component.empty();

Expand Down

0 comments on commit bcfe079

Please sign in to comment.