diff --git a/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java b/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java index 5ab87bfb..891d00f2 100644 --- a/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java +++ b/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java @@ -151,12 +151,15 @@ private void applyRange(SpannableStringBuilder ssb, String type, int start, int setSpan(ssb, new MarkdownFontSizeSpan(mMarkdownStyle.getH1FontSize()), start, end); break; case "blockquote": + MarkdownBlockquoteSpan[] overlappingBlockquotes = ssb.getSpans(start, end, MarkdownBlockquoteSpan.class); + // get the start of the first overlapping blockquote - start of the leadingMarginSpan should be the start of the line + int startIndex = overlappingBlockquotes.length > 0 ? ssb.getSpanStart(overlappingBlockquotes[0]) : start; MarkdownBlockquoteSpan span = new MarkdownBlockquoteSpan( mMarkdownStyle.getBlockquoteBorderColor(), mMarkdownStyle.getBlockquoteBorderWidth(), mMarkdownStyle.getBlockquoteMarginLeft(), mMarkdownStyle.getBlockquotePaddingLeft()); - setSpan(ssb, span, start, end); + setSpan(ssb, span, startIndex, end); break; default: throw new IllegalStateException("Unsupported type: " + type);