diff --git a/README.md b/README.md index 87311b0f..9cc72be9 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ implementation "ru.noties.markwon:core:${markwonVersion}" Please visit [documentation] web-site for further reference +> You can find previous version of Markwon in [2.x.x](https://github.com/noties/Markwon/tree/2.x.x) branch + + ## Supported markdown features: * Emphasis (`*`, `_`) * Strong emphasis (`**`, `__`) diff --git a/gradle.properties b/gradle.properties index 534ca62c..99e26be7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.configureondemand=true android.enableBuildCache=true android.buildCacheDir=build/pre-dex-cache -VERSION_NAME=3.0.0-SNAPSHOT +VERSION_NAME=3.0.0 GROUP=ru.noties.markwon POM_DESCRIPTION=Markwon markdown for Android diff --git a/sample/src/main/java/ru/noties/markwon/sample/SampleItemView.java b/sample/src/main/java/ru/noties/markwon/sample/SampleItemView.java index 76289022..dc4432aa 100644 --- a/sample/src/main/java/ru/noties/markwon/sample/SampleItemView.java +++ b/sample/src/main/java/ru/noties/markwon/sample/SampleItemView.java @@ -2,7 +2,6 @@ import android.support.annotation.NonNull; import android.text.Spannable; -import android.text.SpannableString; import android.text.Spanned; import android.view.LayoutInflater; import android.view.View; @@ -14,20 +13,21 @@ import ru.noties.adapt.Holder; import ru.noties.adapt.ItemView; import ru.noties.markwon.Markwon; +import ru.noties.markwon.utils.NoCopySpannableFactory; class SampleItemView extends ItemView { private final Markwon markwon; // instance specific factory - private final NoCopySpannableFactory factory; + private final Spannable.Factory factory; // instance specific cache private final EnumMap cache; SampleItemView(@NonNull Markwon markwon) { this.markwon = markwon; - this.factory = new NoCopySpannableFactory(); + this.factory = NoCopySpannableFactory.getInstance(); this.cache = new EnumMap<>(SampleItem.class); } @@ -72,13 +72,4 @@ static class SampleHolder extends Holder { this.textView = requireView(R.id.text); } } - - private static class NoCopySpannableFactory extends Spannable.Factory { - @Override - public Spannable newSpannable(CharSequence source) { - return source instanceof Spannable - ? (Spannable) source - : new SpannableString(source); - } - } }