mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-22 21:06:09 +03:00
fixed test
This commit is contained in:
parent
11d878fac9
commit
5861b74382
1 changed files with 7 additions and 4 deletions
|
@ -298,13 +298,16 @@ public class MarkdownUtil {
|
|||
? "\\*?\\*?" + punctuationRex + wildcardRex + punctuationRex + "\\*?\\*?"
|
||||
: punctuationRex + wildcardRex + punctuationRex;
|
||||
final Pattern searchPattern = Pattern.compile(pattern);
|
||||
final int relevantStart = selectionStart - 2;
|
||||
final int relevantEnd = selectionEnd + 2;
|
||||
final Matcher matcher = searchPattern.matcher(initialString).region(Math.max(relevantStart, 0), Math.min(relevantEnd, initialString.length()));
|
||||
int relevantStart = selectionStart - 2;
|
||||
relevantStart = Math.max(relevantStart, 0);
|
||||
int relevantEnd = selectionEnd + 2;
|
||||
relevantEnd = Math.min(relevantEnd, initialString.length());
|
||||
final Matcher matcher = searchPattern.matcher(initialString).region(relevantStart, relevantEnd);
|
||||
|
||||
// if the matcher matches, it's a remove
|
||||
if (matcher.find()) {
|
||||
matcher.reset();
|
||||
// this resets the matcher, while keeping the required region
|
||||
matcher.region(relevantStart, relevantEnd);
|
||||
final int punctuationLength = punctuation.length();
|
||||
final List<Pair<Integer, Integer>> startEnd = new LinkedList<>();
|
||||
int removedCount = 0;
|
||||
|
|
Loading…
Reference in a new issue