Prepare 4.4.0 release
This commit is contained in:
parent
d42ae41409
commit
c2c59041f5
@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
# $nap;
|
||||
# 4.4.0
|
||||
* `TextViewSpan` to obtain `TextView` in which markdown is displayed (applied by `CorePlugin`)
|
||||
* `TextLayoutSpan` to obtain `Layout` in which markdown is displayed (applied by `TablePlugin`, more specifically `TableRowSpan` to propagate layout in which cell content is displayed)
|
||||
* `HtmlEmptyTagReplacement` now is configurable by `HtmlPlugin`, `iframe` handling ([#235])
|
||||
|
@ -8,7 +8,7 @@ android.enableJetifier=true
|
||||
android.enableBuildCache=true
|
||||
android.buildCacheDir=build/pre-dex-cache
|
||||
|
||||
VERSION_NAME=4.4.0-SNAPSHOT
|
||||
VERSION_NAME=4.4.0
|
||||
|
||||
GROUP=io.noties.markwon
|
||||
POM_DESCRIPTION=Markwon markdown for Android
|
||||
|
@ -196,9 +196,9 @@ public abstract class Markwon {
|
||||
* Control if small chunks of non-finished markdown sentences (for example, a single `*` character)
|
||||
* should be displayed/rendered as raw input instead of an empty string.
|
||||
* <p>
|
||||
* Since $nap; {@code true} by default, versions prior - {@code false}
|
||||
* Since 4.4.0 {@code true} by default, versions prior - {@code false}
|
||||
*
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
@NonNull
|
||||
Builder fallbackToRawInputWhenEmpty(boolean fallbackToRawInputWhenEmpty);
|
||||
|
@ -27,7 +27,7 @@ class MarkwonBuilderImpl implements Markwon.Builder {
|
||||
|
||||
private Markwon.TextSetter textSetter;
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
private boolean fallbackToRawInputWhenEmpty = true;
|
||||
|
||||
MarkwonBuilderImpl(@NonNull Context context) {
|
||||
|
@ -24,7 +24,7 @@ public class MarkwonConfiguration {
|
||||
private final AsyncDrawableLoader asyncDrawableLoader;
|
||||
private final SyntaxHighlight syntaxHighlight;
|
||||
private final LinkResolver linkResolver;
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
private final ImageDestinationProcessor imageDestinationProcessor;
|
||||
private final ImageSizeResolver imageSizeResolver;
|
||||
|
||||
@ -62,7 +62,7 @@ public class MarkwonConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
@NonNull
|
||||
public ImageDestinationProcessor imageDestinationProcessor() {
|
||||
@ -89,7 +89,7 @@ public class MarkwonConfiguration {
|
||||
private AsyncDrawableLoader asyncDrawableLoader;
|
||||
private SyntaxHighlight syntaxHighlight;
|
||||
private LinkResolver linkResolver;
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
private ImageDestinationProcessor imageDestinationProcessor;
|
||||
private ImageSizeResolver imageSizeResolver;
|
||||
private MarkwonSpansFactory spansFactory;
|
||||
@ -119,7 +119,7 @@ public class MarkwonConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
@NonNull
|
||||
public Builder imageDestinationProcessor(@NonNull ImageDestinationProcessor imageDestinationProcessor) {
|
||||
@ -157,7 +157,7 @@ public class MarkwonConfiguration {
|
||||
linkResolver = new LinkResolverDef();
|
||||
}
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
if (imageDestinationProcessor == null) {
|
||||
imageDestinationProcessor = ImageDestinationProcessor.noOp();
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class MarkwonImpl extends Markwon {
|
||||
@Nullable
|
||||
private final TextSetter textSetter;
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
private final boolean fallbackToRawInputWhenEmpty;
|
||||
|
||||
MarkwonImpl(
|
||||
@ -96,7 +96,7 @@ class MarkwonImpl extends Markwon {
|
||||
public Spanned toMarkdown(@NonNull String input) {
|
||||
final Spanned spanned = render(parse(input));
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
// if spanned is empty, we are configured to use raw input and input is not empty
|
||||
if (TextUtils.isEmpty(spanned)
|
||||
&& fallbackToRawInputWhenEmpty
|
||||
|
@ -97,7 +97,7 @@ public class CorePlugin extends AbstractMarkwonPlugin {
|
||||
|
||||
/**
|
||||
* @return a set with enabled by default block types
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
@NonNull
|
||||
public static Set<Class<? extends Block>> enabledBlockTypes() {
|
||||
@ -175,7 +175,7 @@ public class CorePlugin extends AbstractMarkwonPlugin {
|
||||
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
||||
OrderedListItemSpan.measure(textView, markdown);
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
// we do not break API compatibility, instead we introduce the `instance of` check
|
||||
if (markdown instanceof Spannable) {
|
||||
final Spannable spannable = (Spannable) markdown;
|
||||
|
@ -10,7 +10,7 @@ import androidx.annotation.Nullable;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public class TextLayoutSpan {
|
||||
|
||||
|
@ -12,7 +12,7 @@ import java.lang.ref.WeakReference;
|
||||
/**
|
||||
* A special span that allows to obtain {@code TextView} in which spans are displayed
|
||||
*
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public class TextViewSpan {
|
||||
|
||||
|
@ -100,7 +100,7 @@ public class AsyncDrawableSpan extends ReplacementSpan {
|
||||
int bottom,
|
||||
@NonNull Paint paint) {
|
||||
|
||||
// @since $nap; use SpanUtils instead of `canvas.getWidth`
|
||||
// @since 4.4.0 use SpanUtils instead of `canvas.getWidth`
|
||||
drawable.initWithKnownDimensions(
|
||||
SpanUtils.width(canvas, text),
|
||||
paint.getTextSize()
|
||||
|
@ -5,7 +5,7 @@ import androidx.annotation.NonNull;
|
||||
/**
|
||||
* Process destination of image nodes
|
||||
*
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public abstract class ImageDestinationProcessor {
|
||||
@NonNull
|
||||
|
@ -15,7 +15,7 @@ import androidx.annotation.Nullable;
|
||||
* {@code FileSchemeHandler} from the {@code image} module supports asset images when created with
|
||||
* {@code createWithAssets} factory method
|
||||
*
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public class ImageDestinationProcessorAssets extends ImageDestinationProcessor {
|
||||
|
||||
|
@ -7,7 +7,7 @@ import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public class ImageDestinationProcessorRelativeToAbsolute extends ImageDestinationProcessor {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import android.text.Layout;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public abstract class LayoutUtils {
|
||||
|
||||
|
@ -11,7 +11,7 @@ import io.noties.markwon.core.spans.TextLayoutSpan;
|
||||
import io.noties.markwon.core.spans.TextViewSpan;
|
||||
|
||||
/**
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public abstract class SpanUtils {
|
||||
|
||||
|
@ -529,7 +529,7 @@ public class JLatexMathPlugin extends AbstractMarkwonPlugin {
|
||||
@Override
|
||||
public Rect resolveImageSize(@NonNull AsyncDrawable drawable) {
|
||||
|
||||
// @since $nap; resolve inline size (scale down if exceed available width)
|
||||
// @since 4.4.0 resolve inline size (scale down if exceed available width)
|
||||
final Rect imageBounds = drawable.getResult().getBounds();
|
||||
final int canvasWidth = drawable.getLastKnownCanvasWidth();
|
||||
final int w = imageBounds.width();
|
||||
|
@ -339,10 +339,10 @@ public class TableRowSpan extends ReplacementSpan {
|
||||
false
|
||||
);
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
TextLayoutSpan.applyTo(spannable, layout);
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
scheduleAsyncDrawables(spannable, recreate);
|
||||
|
||||
layouts.add(index, layout);
|
||||
|
@ -46,7 +46,7 @@ public class HtmlEmptyTagReplacement {
|
||||
replacement = alt;
|
||||
}
|
||||
} else if ("iframe".equals(name)) {
|
||||
// @since $nap; make iframe non-empty
|
||||
// @since 4.4.0 make iframe non-empty
|
||||
replacement = IFRAME_REPLACEMENT;
|
||||
} else {
|
||||
replacement = null;
|
||||
|
@ -57,7 +57,7 @@ public class HtmlPlugin extends AbstractMarkwonPlugin {
|
||||
private MarkwonHtmlParser htmlParser;
|
||||
private MarkwonHtmlRenderer htmlRenderer;
|
||||
|
||||
// @since $nap;
|
||||
// @since 4.4.0
|
||||
private HtmlEmptyTagReplacement emptyTagReplacement = new HtmlEmptyTagReplacement();
|
||||
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@ -109,7 +109,7 @@ public class HtmlPlugin extends AbstractMarkwonPlugin {
|
||||
|
||||
/**
|
||||
* @param emptyTagReplacement {@link HtmlEmptyTagReplacement}
|
||||
* @since $nap;
|
||||
* @since 4.4.0
|
||||
*/
|
||||
@NonNull
|
||||
public HtmlPlugin emptyTagReplacement(@NonNull HtmlEmptyTagReplacement emptyTagReplacement) {
|
||||
|
@ -38,7 +38,8 @@ For example, `@since $nap` seems like a good candidate. For this a live template
|
||||
whenever a new API method/field/functionality-change is introduced (`snc`):
|
||||
|
||||
```
|
||||
@since $nap;
|
||||
// semicolon with a space so this one is not accedentally replaced with release version
|
||||
@since $nap ;
|
||||
```
|
||||
|
||||
This live template would be possible to use in both inline comment and javadoc comment.
|
||||
|
Loading…
x
Reference in New Issue
Block a user