Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested support blockquotes on Android #98

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading