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

Paragraph text can now explicitly be spanned #58

Merged
merged 1 commit into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions library/src/main/java/ru/noties/markwon/SpannableFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Object tableRow(
boolean isHeader,
boolean isOdd);

@Nullable
Object paragraph(boolean inTightList);

@Nullable
Object image(
@NonNull SpannableTheme theme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ public Object tableRow(@NonNull SpannableTheme theme, @NonNull List<TableRowSpan
return new TableRowSpan(theme, cells, isHeader, isOdd);
}

@Nullable
@Override
public Object paragraph(boolean inTightList) {
return null;
}

@Nullable
@Override
public Object image(@NonNull SpannableTheme theme, @NonNull String destination, @NonNull AsyncDrawable.Loader loader, @NonNull ImageSizeResolver imageSizeResolver, @Nullable ImageSize imageSize, boolean replacementTextIsLink) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,15 @@ private boolean handleTableNodes(CustomNode node) {

@Override
public void visit(Paragraph paragraph) {

final boolean inTightList = isInTightList(paragraph);

if (!inTightList) {
newLine();
}

final int length = builder.length();
visitChildren(paragraph);
setSpan(length, factory.paragraph(inTightList));

if (!inTightList) {
newLine();
Expand Down