Update recipes documentation page
This commit is contained in:
parent
06c2763ac6
commit
18b1d5b0bb
@ -18,6 +18,49 @@ Do not use `autolink` XML attribute on your `TextView` as it will remove all lin
|
|||||||
Consider using [linkify plugin](/docs/v4/linkify/) or commonmark-java [autolink extension](https://github.com/atlassian/commonmark-java)
|
Consider using [linkify plugin](/docs/v4/linkify/) or commonmark-java [autolink extension](https://github.com/atlassian/commonmark-java)
|
||||||
|
|
||||||
|
|
||||||
|
## List item spacing
|
||||||
|
|
||||||
|
If your list items, task list items or paragraphs need special space between them
|
||||||
|
(increasing spacing between them, but keeping the original line height),
|
||||||
|
`LastLineSpacingSpan` <Badge text="4.0.0" /> can be used:
|
||||||
|
|
||||||
|
```java
|
||||||
|
final Markwon markwon = Markwon.builder(context)
|
||||||
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
|
@Override
|
||||||
|
public void configureSpansFactory(@NonNull MarkwonSpansFactory.Builder builder) {
|
||||||
|
// or Paragraph, or TaskListItem
|
||||||
|
builder.addFactory(ListItem.class, new SpanFactory() {
|
||||||
|
@Override
|
||||||
|
public Object getSpans(@NonNull MarkwonConfiguration configuration, @NonNull RenderProps props) {
|
||||||
|
return new LastLineSpacingSpan(spacingPx);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.build();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Softbreak new-line
|
||||||
|
|
||||||
|
If you want to add a new line when a `softbreak` is used:
|
||||||
|
|
||||||
|
```java
|
||||||
|
final Markwon markwon = Markwon.builder(context)
|
||||||
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
|
@Override
|
||||||
|
public void configureVisitor(@NonNull MarkwonVisitor.Builder builder) {
|
||||||
|
builder.on(SoftLineBreak.class, new MarkwonVisitor.NodeVisitor<SoftLineBreak>() {
|
||||||
|
@Override
|
||||||
|
public void visit(@NonNull MarkwonVisitor visitor, @NonNull SoftLineBreak softLineBreak) {
|
||||||
|
visitor.forceNewLine();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.build();
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Custom typeface
|
## Custom typeface
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user