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