Prepare 4.3.0 release
This commit is contained in:
parent
b5a30a55b3
commit
fe3d567619
@ -70,4 +70,33 @@ public void configureVisitor(@NonNull MarkwonVisitor.Builder builder) {
|
||||
}
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
### BlockHandler <Badge text="4.3.0" />
|
||||
|
||||
Since <Badge text="4.3.0" /> there is class to control insertions of new lines after markdown blocks
|
||||
`BlockHandler` (`MarkwonVisitor.BlockHandler`) and its default implementation `BlockHandlerDef`. For example,
|
||||
to disable an empty new line after `Heading`:
|
||||
|
||||
```java
|
||||
final Markwon markwon = Markwon.builder(this)
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
@Override
|
||||
public void configureVisitor(@NonNull MarkwonVisitor.Builder builder) {
|
||||
builder.blockHandler(new BlockHandlerDef() {
|
||||
@Override
|
||||
public void blockEnd(@NonNull MarkwonVisitor visitor, @NonNull Node node) {
|
||||
if (node instanceof Heading) {
|
||||
if (visitor.hasNext(node)) {
|
||||
visitor.ensureNewLine();
|
||||
// ensure new line but do not force insert one
|
||||
}
|
||||
} else {
|
||||
super.blockEnd(visitor, node);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.build();
|
||||
```
|
@ -3,6 +3,16 @@
|
||||
**Experimental** commonmark-java inline parser that allows customizing
|
||||
core features and/or extend with own.
|
||||
|
||||
:::tip
|
||||
Since <Badge text="4.3.0" /> there is also `MarkwonInlineParserPlugin` which can be used
|
||||
to allow other plugins to customize inline parser
|
||||
```java
|
||||
final Markwon markwon = Markwon.builder(this)
|
||||
.usePlugin(MarkwonInlineParserPlugin.create())
|
||||
.build();
|
||||
```
|
||||
:::
|
||||
|
||||
Usage of _internal_ classes:
|
||||
```java
|
||||
import org.commonmark.internal.Bracket;
|
||||
|
@ -8,7 +8,7 @@ android.enableJetifier=true
|
||||
android.enableBuildCache=true
|
||||
android.buildCacheDir=build/pre-dex-cache
|
||||
|
||||
VERSION_NAME=4.3.0-SNAPSHOT
|
||||
VERSION_NAME=4.3.0
|
||||
|
||||
GROUP=io.noties.markwon
|
||||
POM_DESCRIPTION=Markwon markdown for Android
|
||||
|
@ -5,7 +5,7 @@ import androidx.annotation.NonNull;
|
||||
import org.commonmark.node.Node;
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public class BlockHandlerDef implements MarkwonVisitor.BlockHandler {
|
||||
@Override
|
||||
|
@ -13,7 +13,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
public class LinkResolverDef implements LinkResolver {
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
private static final String DEFAULT_SCHEME = "https";
|
||||
|
||||
@Override
|
||||
@ -30,7 +30,7 @@ public class LinkResolverDef implements LinkResolver {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@NonNull
|
||||
private static Uri parseLink(@NonNull String link) {
|
||||
|
@ -27,7 +27,7 @@ public interface MarkwonVisitor extends Visitor {
|
||||
* Primary purpose is to control the spacing applied before/after certain blocks, which
|
||||
* visitors are created elsewhere
|
||||
*
|
||||
* @since $nap;
|
||||
* @since 4.3.0
|
||||
*/
|
||||
interface BlockHandler {
|
||||
|
||||
@ -50,7 +50,7 @@ public interface MarkwonVisitor extends Visitor {
|
||||
* @param blockHandler to handle block start/end
|
||||
* @see BlockHandler
|
||||
* @see BlockHandlerDef
|
||||
* @since $nap;
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@SuppressWarnings("UnusedReturnValue")
|
||||
@NonNull
|
||||
@ -158,12 +158,12 @@ public interface MarkwonVisitor extends Visitor {
|
||||
<N extends Node> void setSpansForNodeOptional(@NonNull Class<N> node, int start);
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.3.0
|
||||
*/
|
||||
void blockStart(@NonNull Node node);
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.3.0
|
||||
*/
|
||||
void blockEnd(@NonNull Node node);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class MarkwonVisitorImpl implements MarkwonVisitor {
|
||||
|
||||
private final Map<Class<? extends Node>, NodeVisitor<? extends Node>> nodes;
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.3.0
|
||||
private final BlockHandler blockHandler;
|
||||
|
||||
MarkwonVisitorImpl(
|
||||
@ -316,7 +316,7 @@ class MarkwonVisitorImpl implements MarkwonVisitor {
|
||||
@NonNull
|
||||
@Override
|
||||
public MarkwonVisitor build(@NonNull MarkwonConfiguration configuration, @NonNull RenderProps renderProps) {
|
||||
// @since $nap;
|
||||
// @since 4.3.0
|
||||
BlockHandler blockHandler = this.blockHandler;
|
||||
if (blockHandler == null) {
|
||||
blockHandler = new BlockHandlerDef();
|
||||
|
@ -5,7 +5,7 @@ import androidx.annotation.NonNull;
|
||||
import org.commonmark.node.SoftLineBreak;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public class SoftBreakAddsNewLinePlugin extends AbstractMarkwonPlugin {
|
||||
|
||||
|
@ -274,7 +274,7 @@ public class AsyncDrawable extends Drawable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@NonNull
|
||||
private static Rect noDimensionsBounds(@Nullable Drawable result) {
|
||||
|
@ -15,7 +15,7 @@ import ru.noties.jlatexmath.JLatexMathDrawable;
|
||||
import ru.noties.jlatexmath.awt.Color;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public class JLatexAsyncDrawableSpan extends AsyncDrawableSpan {
|
||||
|
||||
|
@ -12,7 +12,7 @@ import io.noties.markwon.core.MarkwonTheme;
|
||||
import io.noties.markwon.image.AsyncDrawable;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
class JLatexInlineAsyncDrawableSpan extends JLatexAsyncDrawableSpan {
|
||||
|
||||
|
@ -12,7 +12,7 @@ import org.commonmark.parser.block.MatchedBlockParser;
|
||||
import org.commonmark.parser.block.ParserState;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT (although there was a class with the same name,
|
||||
* @since 4.3.0 (although there was a class with the same name,
|
||||
* which is renamed now to {@link JLatexMathBlockParserLegacy})
|
||||
*/
|
||||
class JLatexMathBlockParser extends AbstractBlockParser {
|
||||
|
@ -9,7 +9,7 @@ import org.commonmark.parser.block.MatchedBlockParser;
|
||||
import org.commonmark.parser.block.ParserState;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT (although it is just renamed parser from previous versions)
|
||||
* @since 4.3.0 (although it is just renamed parser from previous versions)
|
||||
*/
|
||||
class JLatexMathBlockParserLegacy extends AbstractBlockParser {
|
||||
|
||||
|
@ -9,7 +9,7 @@ import java.util.regex.Pattern;
|
||||
import io.noties.markwon.inlineparser.InlineProcessor;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
class JLatexMathInlineProcessor extends InlineProcessor {
|
||||
|
||||
|
@ -3,7 +3,7 @@ package io.noties.markwon.ext.latex;
|
||||
import org.commonmark.node.CustomNode;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public class JLatexMathNode extends CustomNode {
|
||||
|
||||
|
@ -40,7 +40,7 @@ import ru.noties.jlatexmath.JLatexMathDrawable;
|
||||
public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public interface ErrorHandler {
|
||||
|
||||
@ -64,7 +64,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@NonNull
|
||||
public static JLatexMathPlugin create(@Px float inlineTextSize, @Px float blockTextSize) {
|
||||
@ -84,7 +84,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@NonNull
|
||||
public static JLatexMathPlugin create(
|
||||
@ -102,7 +102,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@NonNull
|
||||
public static JLatexMathPlugin.Builder builder(@Px float inlineTextSize, @Px float blockTextSize) {
|
||||
@ -112,15 +112,15 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
@VisibleForTesting
|
||||
static class Config {
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
final JLatexMathTheme theme;
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
final boolean blocksEnabled;
|
||||
final boolean blocksLegacy;
|
||||
final boolean inlinesEnabled;
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
final ErrorHandler errorHandler;
|
||||
|
||||
final ExecutorService executorService;
|
||||
@ -166,7 +166,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
|
||||
@Override
|
||||
public void configureParser(@NonNull Parser.Builder builder) {
|
||||
// @since $nap;
|
||||
// @since 4.3.0
|
||||
if (config.blocksEnabled) {
|
||||
if (config.blocksLegacy) {
|
||||
builder.customBlockParserFactory(new JLatexMathBlockParserLegacy.Factory());
|
||||
@ -278,15 +278,15 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
@SuppressWarnings({"unused", "UnusedReturnValue"})
|
||||
public static class Builder {
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
private final JLatexMathTheme.Builder theme;
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
private boolean blocksEnabled = true;
|
||||
private boolean blocksLegacy;
|
||||
private boolean inlinesEnabled;
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
private ErrorHandler errorHandler;
|
||||
|
||||
// @since 4.0.0
|
||||
@ -302,7 +302,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@NonNull
|
||||
public Builder blocksEnabled(boolean blocksEnabled) {
|
||||
@ -312,7 +312,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
|
||||
/**
|
||||
* @param blocksLegacy indicates if blocks should be handled in legacy mode ({@code pre 4.3.0})
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@NonNull
|
||||
public Builder blocksLegacy(boolean blocksLegacy) {
|
||||
@ -323,7 +323,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
/**
|
||||
* @param inlinesEnabled indicates if inline parsing should be enabled.
|
||||
* NB, this requires `MarkwonInlineParserPlugin` to be used when creating `MarkwonInstance`
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
@NonNull
|
||||
public Builder inlinesEnabled(boolean inlinesEnabled) {
|
||||
@ -384,7 +384,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
try {
|
||||
execute();
|
||||
} catch (Throwable t) {
|
||||
// @since 4.3.0-SNAPSHOT add error handling
|
||||
// @since 4.3.0 add error handling
|
||||
final ErrorHandler errorHandler = config.errorHandler;
|
||||
if (errorHandler == null) {
|
||||
// as before
|
||||
@ -444,7 +444,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
return null;
|
||||
}
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
@NonNull
|
||||
private JLatexMathDrawable createBlockDrawable(@NonNull JLatextAsyncDrawable drawable) {
|
||||
|
||||
@ -476,7 +476,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
@NonNull
|
||||
private JLatexMathDrawable createInlineDrawable(@NonNull JLatextAsyncDrawable drawable) {
|
||||
|
||||
@ -507,7 +507,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
private void setResult(@NonNull final AsyncDrawable drawable, @NonNull final Drawable result) {
|
||||
// we must post to handler, but also have a way to identify the drawable
|
||||
// for which we are posting (in case of cancellation)
|
||||
|
@ -10,7 +10,7 @@ import androidx.annotation.Px;
|
||||
import ru.noties.jlatexmath.JLatexMathDrawable;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public abstract class JLatexMathTheme {
|
||||
|
||||
@ -35,7 +35,7 @@ public abstract class JLatexMathTheme {
|
||||
}
|
||||
|
||||
/**
|
||||
* Moved from {@link JLatexMathPlugin} in {@code 4.3.0-SNAPSHOT} version
|
||||
* Moved from {@link JLatexMathPlugin} in {@code 4.3.0} version
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
|
@ -9,7 +9,7 @@ import io.noties.markwon.image.ImageSize;
|
||||
import io.noties.markwon.image.ImageSizeResolver;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
class JLatextAsyncDrawable extends AsyncDrawable {
|
||||
|
||||
|
@ -7,7 +7,7 @@ import org.commonmark.parser.Parser;
|
||||
import io.noties.markwon.AbstractMarkwonPlugin;
|
||||
|
||||
/**
|
||||
* @since 4.3.0-SNAPSHOT
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public class MarkwonInlineParserPlugin extends AbstractMarkwonPlugin {
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class LinkifyPlugin extends AbstractMarkwonPlugin {
|
||||
* @param useCompat If true, use {@link LinkifyCompat} to handle links.
|
||||
* Note that the {@link LinkifyCompat} depends on androidx.core:core,
|
||||
* the dependency must be added on a client side explicitly.
|
||||
* @since 4.3.0-SNAPSHOT `useCompat` argument
|
||||
* @since 4.3.0 `useCompat` argument
|
||||
*/
|
||||
@NonNull
|
||||
public static LinkifyPlugin create(boolean useCompat) {
|
||||
@ -58,7 +58,7 @@ public class LinkifyPlugin extends AbstractMarkwonPlugin {
|
||||
* @param useCompat If true, use {@link LinkifyCompat} to handle links.
|
||||
* Note that the {@link LinkifyCompat} depends on androidx.core:core,
|
||||
* the dependency must be added on a client side explicitly.
|
||||
* @since 4.3.0-SNAPSHOT `useCompat` argument
|
||||
* @since 4.3.0 `useCompat` argument
|
||||
*/
|
||||
@NonNull
|
||||
public static LinkifyPlugin create(@LinkifyMask int mask, boolean useCompat) {
|
||||
@ -80,7 +80,7 @@ public class LinkifyPlugin extends AbstractMarkwonPlugin {
|
||||
@Override
|
||||
public void apply(@NonNull CorePlugin corePlugin) {
|
||||
final LinkifyTextAddedListener listener;
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
if (useCompat) {
|
||||
listener = new LinkifyCompatTextAddedListener(mask);
|
||||
} else {
|
||||
@ -140,7 +140,7 @@ public class LinkifyPlugin extends AbstractMarkwonPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
// @since 4.3.0-SNAPSHOT
|
||||
// @since 4.3.0
|
||||
private static class LinkifyCompatTextAddedListener extends LinkifyTextAddedListener {
|
||||
|
||||
LinkifyCompatTextAddedListener(int mask) {
|
||||
|
@ -41,4 +41,8 @@ whenever a new API method/field/functionality-change is introduced (`snc`):
|
||||
@since $nap;
|
||||
```
|
||||
|
||||
This live template would be possible to use in both inline comment and javadoc comment.
|
||||
This live template would be possible to use in both inline comment and javadoc comment.
|
||||
|
||||
## documentation
|
||||
|
||||
If there are updates to documentation web site, do not forget to publish it
|
@ -323,26 +323,26 @@ public class BasicPluginsActivity extends ActivityWithMenuOptions {
|
||||
}
|
||||
|
||||
private void headingNoSpaceBlockHandler() {
|
||||
final Markwon markwon = Markwon.builder(this)
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
final Markwon markwon = Markwon.builder(this)
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
@Override
|
||||
public void configureVisitor(@NonNull MarkwonVisitor.Builder builder) {
|
||||
builder.blockHandler(new BlockHandlerDef() {
|
||||
@Override
|
||||
public void configureVisitor(@NonNull MarkwonVisitor.Builder builder) {
|
||||
builder.blockHandler(new BlockHandlerDef() {
|
||||
@Override
|
||||
public void blockEnd(@NonNull MarkwonVisitor visitor, @NonNull Node node) {
|
||||
if (node instanceof Heading) {
|
||||
if (visitor.hasNext(node)) {
|
||||
visitor.ensureNewLine();
|
||||
// ensure new line but do not force insert one
|
||||
}
|
||||
} else {
|
||||
super.blockEnd(visitor, node);
|
||||
}
|
||||
public void blockEnd(@NonNull MarkwonVisitor visitor, @NonNull Node node) {
|
||||
if (node instanceof Heading) {
|
||||
if (visitor.hasNext(node)) {
|
||||
visitor.ensureNewLine();
|
||||
// ensure new line but do not force insert one
|
||||
}
|
||||
});
|
||||
} else {
|
||||
super.blockEnd(visitor, node);
|
||||
}
|
||||
}
|
||||
})
|
||||
.build();
|
||||
});
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
final String md = "" +
|
||||
"# Title title title title title title title title title title \n\ntext text text text";
|
||||
|
@ -24,6 +24,7 @@ import io.noties.markwon.Markwon;
|
||||
import io.noties.markwon.inlineparser.BackticksInlineProcessor;
|
||||
import io.noties.markwon.inlineparser.CloseBracketInlineProcessor;
|
||||
import io.noties.markwon.inlineparser.MarkwonInlineParser;
|
||||
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||
import io.noties.markwon.inlineparser.OpenBracketInlineProcessor;
|
||||
import io.noties.markwon.sample.ActivityWithMenuOptions;
|
||||
import io.noties.markwon.sample.MenuOptions;
|
||||
@ -38,7 +39,9 @@ public class InlineParserActivity extends ActivityWithMenuOptions {
|
||||
public MenuOptions menuOptions() {
|
||||
return MenuOptions.create()
|
||||
.add("links_only", this::links_only)
|
||||
.add("disable_code", this::disable_code);
|
||||
.add("disable_code", this::disable_code)
|
||||
.add("pluginWithDefaults", this::pluginWithDefaults)
|
||||
.add("pluginNoDefaults", this::pluginNoDefaults);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -124,4 +127,50 @@ public class InlineParserActivity extends ActivityWithMenuOptions {
|
||||
"**Good day!**";
|
||||
markwon.setMarkdown(textView, md);
|
||||
}
|
||||
|
||||
private void pluginWithDefaults() {
|
||||
// a plugin with defaults registered
|
||||
|
||||
final String md = "no [links](#) for **you** `code`!";
|
||||
|
||||
final Markwon markwon = Markwon.builder(this)
|
||||
.usePlugin(MarkwonInlineParserPlugin.create())
|
||||
// the same as:
|
||||
// .usePlugin(MarkwonInlineParserPlugin.create(MarkwonInlineParser.factoryBuilder()))
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
@Override
|
||||
public void configure(@NonNull Registry registry) {
|
||||
registry.require(MarkwonInlineParserPlugin.class, plugin -> {
|
||||
plugin.factoryBuilder()
|
||||
.excludeInlineProcessor(OpenBracketInlineProcessor.class);
|
||||
});
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
markwon.setMarkdown(textView, md);
|
||||
}
|
||||
|
||||
private void pluginNoDefaults() {
|
||||
// a plugin with NO defaults registered
|
||||
|
||||
final String md = "no [links](#) for **you** `code`!";
|
||||
|
||||
final Markwon markwon = Markwon.builder(this)
|
||||
// pass `MarkwonInlineParser.factoryBuilderNoDefaults()` no disable all
|
||||
.usePlugin(MarkwonInlineParserPlugin.create(MarkwonInlineParser.factoryBuilderNoDefaults()))
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
@Override
|
||||
public void configure(@NonNull Registry registry) {
|
||||
registry.require(MarkwonInlineParserPlugin.class, plugin -> {
|
||||
plugin.factoryBuilder()
|
||||
.addInlineProcessor(new BackticksInlineProcessor());
|
||||
});
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
markwon.setMarkdown(textView, md);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ public class LatexActivity extends ActivityWithMenuOptions {
|
||||
}
|
||||
|
||||
private void defaultTextColor() {
|
||||
// @since 4.3.0-SNAPSHOT text color is automatically taken from textView
|
||||
// @since 4.3.0 text color is automatically taken from textView
|
||||
// (if it's not specified explicitly via configuration)
|
||||
textView.setTextColor(0xFFff0000);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user