Skip to content

Commit

Permalink
Add getEnd() method in MarkdownRange
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw committed Dec 7, 2024
1 parent 5695408 commit ff76731
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private void applyRanges(SpannableStringBuilder ssb, List<MarkdownRange> markdow
private void applyRange(SpannableStringBuilder ssb, MarkdownRange markdownRange, MarkdownStyle markdownStyle) {
String type = markdownRange.getType();
int start = markdownRange.getStart();
int end = start + markdownRange.getLength();
int end = markdownRange.getEnd();
switch (type) {
case "bold":
setSpan(ssb, new MarkdownBoldSpan(), start, end);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
public class MarkdownRange {
private final String mType;
private final int mStart;
private final int mEnd;
private final int mLength;
private final int mDepth;

public MarkdownRange(String type, int start, int length, int depth) {
mType = type;
mStart = start;
mEnd = start + length;
mLength = length;
mDepth = depth;
}
Expand All @@ -21,6 +23,10 @@ public int getStart() {
return mStart;
}

public int getEnd() {
return mEnd;
}

public int getLength() {
return mLength;
}
Expand Down

0 comments on commit ff76731

Please sign in to comment.