
* Added retention annotation for Alignment IntDef (#3) * Task lists (#4) * Added since annotation to newly added method/classes * Fixed the indexes bug for margin spans (#6) * Feature: Revert spans order (#11) * SpannableBuilder * Removed nullablity from Markwon class (no null markdown) * Image sizes via HTML (#13)
19 lines
534 B
Java
19 lines
534 B
Java
package ru.noties.markwon.renderer;
|
|
|
|
import android.support.annotation.NonNull;
|
|
|
|
import org.commonmark.node.Node;
|
|
|
|
import ru.noties.markwon.SpannableBuilder;
|
|
import ru.noties.markwon.SpannableConfiguration;
|
|
|
|
public class SpannableRenderer {
|
|
|
|
@NonNull
|
|
public CharSequence render(@NonNull SpannableConfiguration configuration, @NonNull Node node) {
|
|
final SpannableBuilder builder = new SpannableBuilder();
|
|
node.accept(new SpannableMarkdownVisitor(configuration, builder));
|
|
return builder.text();
|
|
}
|
|
}
|