mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-30 03:24:44 +01:00
More fixes related to markdown rendering
This commit is contained in:
parent
d6d6ed5407
commit
2cdf523eff
@ -153,7 +153,7 @@ dependencies {
|
|||||||
implementation "io.noties.markwon:linkify:$markwonVersion"
|
implementation "io.noties.markwon:linkify:$markwonVersion"
|
||||||
implementation "io.noties.markwon:recycler-table:$markwonVersion"
|
implementation "io.noties.markwon:recycler-table:$markwonVersion"
|
||||||
implementation "io.noties.markwon:simple-ext:$markwonVersion"
|
implementation "io.noties.markwon:simple-ext:$markwonVersion"
|
||||||
implementation "io.noties.markwon:html:$markwonVersion"
|
implementation "io.noties.markwon:inline-parser:$markwonVersion"
|
||||||
implementation 'com.atlassian.commonmark:commonmark-ext-gfm-tables:0.14.0'
|
implementation 'com.atlassian.commonmark:commonmark-ext-gfm-tables:0.14.0'
|
||||||
implementation 'me.saket:better-link-movement-method:2.2.0'
|
implementation 'me.saket:better-link-movement-method:2.2.0'
|
||||||
|
|
||||||
|
@ -50,7 +50,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.recycler.MarkwonAdapter;
|
import io.noties.markwon.recycler.MarkwonAdapter;
|
||||||
import io.noties.markwon.recycler.table.TableEntry;
|
import io.noties.markwon.recycler.table.TableEntry;
|
||||||
@ -160,7 +161,9 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
|
|||||||
|
|
||||||
int linkColor = mCustomThemeWrapper.getLinkColor();
|
int linkColor = mCustomThemeWrapper.getLinkColor();
|
||||||
Markwon markwon = Markwon.builder(this)
|
Markwon markwon = Markwon.builder(this)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@Override
|
@Override
|
||||||
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
||||||
@ -201,7 +204,9 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
|
|||||||
contentMarkdownRecyclerView.setVisibility(View.VISIBLE);
|
contentMarkdownRecyclerView.setVisibility(View.VISIBLE);
|
||||||
contentMarkdownRecyclerView.setNestedScrollingEnabled(false);
|
contentMarkdownRecyclerView.setNestedScrollingEnabled(false);
|
||||||
Markwon postBodyMarkwon = Markwon.builder(this)
|
Markwon postBodyMarkwon = Markwon.builder(this)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
||||||
|
@ -47,7 +47,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.recycler.MarkwonAdapter;
|
import io.noties.markwon.recycler.MarkwonAdapter;
|
||||||
import io.noties.markwon.recycler.table.TableEntry;
|
import io.noties.markwon.recycler.table.TableEntry;
|
||||||
@ -131,7 +132,9 @@ public class FullMarkdownActivity extends BaseActivity {
|
|||||||
int spoilerBackgroundColor = markdownColor | 0xFF000000;
|
int spoilerBackgroundColor = markdownColor | 0xFF000000;
|
||||||
int linkColor = mCustomThemeWrapper.getLinkColor();
|
int linkColor = mCustomThemeWrapper.getLinkColor();
|
||||||
Markwon markwon = Markwon.builder(this)
|
Markwon markwon = Markwon.builder(this)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
@ -152,7 +155,7 @@ public class FullMarkdownActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void afterSetText(@NonNull TextView textView) {
|
public void afterSetText(@NonNull TextView textView) {
|
||||||
textView.setHighlightColor(Color.TRANSPARENT);
|
textView.setHighlightColor(Color.TRANSPARENT);
|
||||||
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText().toString());
|
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText());
|
||||||
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
|
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
|
||||||
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
|
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
|
||||||
int start = 0;
|
int start = 0;
|
||||||
|
@ -71,6 +71,8 @@ import io.noties.markwon.AbstractMarkwonPlugin;
|
|||||||
import io.noties.markwon.Markwon;
|
import io.noties.markwon.Markwon;
|
||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.movement.MovementMethodPlugin;
|
import io.noties.markwon.movement.MovementMethodPlugin;
|
||||||
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
|
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
|
||||||
@ -380,6 +382,9 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
Locale locale = getResources().getConfiguration().locale;
|
Locale locale = getResources().getConfiguration().locale;
|
||||||
|
|
||||||
Markwon markwon = Markwon.builder(this)
|
Markwon markwon = Markwon.builder(this)
|
||||||
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@Override
|
@Override
|
||||||
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
||||||
|
@ -73,6 +73,8 @@ import io.noties.markwon.AbstractMarkwonPlugin;
|
|||||||
import io.noties.markwon.Markwon;
|
import io.noties.markwon.Markwon;
|
||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.movement.MovementMethodPlugin;
|
import io.noties.markwon.movement.MovementMethodPlugin;
|
||||||
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
|
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
|
||||||
@ -376,6 +378,9 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
|||||||
Locale locale = getResources().getConfiguration().locale;
|
Locale locale = getResources().getConfiguration().locale;
|
||||||
|
|
||||||
Markwon markwon = Markwon.builder(this)
|
Markwon markwon = Markwon.builder(this)
|
||||||
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@Override
|
@Override
|
||||||
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
||||||
|
@ -51,7 +51,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.recycler.MarkwonAdapter;
|
import io.noties.markwon.recycler.MarkwonAdapter;
|
||||||
import io.noties.markwon.recycler.table.TableEntry;
|
import io.noties.markwon.recycler.table.TableEntry;
|
||||||
@ -156,7 +157,9 @@ public class WikiActivity extends BaseActivity {
|
|||||||
int spoilerBackgroundColor = markdownColor | 0xFF000000;
|
int spoilerBackgroundColor = markdownColor | 0xFF000000;
|
||||||
int linkColor = mCustomThemeWrapper.getLinkColor();
|
int linkColor = mCustomThemeWrapper.getLinkColor();
|
||||||
markwon = Markwon.builder(this)
|
markwon = Markwon.builder(this)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
@ -177,7 +180,7 @@ public class WikiActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void afterSetText(@NonNull TextView textView) {
|
public void afterSetText(@NonNull TextView textView) {
|
||||||
textView.setHighlightColor(Color.TRANSPARENT);
|
textView.setHighlightColor(Color.TRANSPARENT);
|
||||||
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText().toString());
|
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText());
|
||||||
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
|
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
|
||||||
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
|
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
|
||||||
int start = 0;
|
int start = 0;
|
||||||
|
@ -42,7 +42,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
||||||
import ml.docilealligator.infinityforreddit.NetworkState;
|
import ml.docilealligator.infinityforreddit.NetworkState;
|
||||||
@ -116,7 +117,9 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
|||||||
mCommentColor = customThemeWrapper.getCommentColor();
|
mCommentColor = customThemeWrapper.getCommentColor();
|
||||||
int commentSpoilerBackgroundColor = mCommentColor | 0xFF000000;
|
int commentSpoilerBackgroundColor = mCommentColor | 0xFF000000;
|
||||||
mMarkwon = Markwon.builder(mActivity)
|
mMarkwon = Markwon.builder(mActivity)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
|
@ -47,7 +47,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.movement.MovementMethodPlugin;
|
import io.noties.markwon.movement.MovementMethodPlugin;
|
||||||
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
||||||
@ -160,7 +161,9 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
int commentSpoilerBackgroundColor = mCommentTextColor | 0xFF000000;
|
int commentSpoilerBackgroundColor = mCommentTextColor | 0xFF000000;
|
||||||
int linkColor = customThemeWrapper.getLinkColor();
|
int linkColor = customThemeWrapper.getLinkColor();
|
||||||
mCommentMarkwon = Markwon.builder(mActivity)
|
mCommentMarkwon = Markwon.builder(mActivity)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,7 +34,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import ml.docilealligator.infinityforreddit.NetworkState;
|
import ml.docilealligator.infinityforreddit.NetworkState;
|
||||||
import ml.docilealligator.infinityforreddit.R;
|
import ml.docilealligator.infinityforreddit.R;
|
||||||
@ -99,7 +100,9 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter<Message, Recycl
|
|||||||
mButtonTextColor = customThemeWrapper.getButtonTextColor();
|
mButtonTextColor = customThemeWrapper.getButtonTextColor();
|
||||||
|
|
||||||
mMarkwon = Markwon.builder(mContext)
|
mMarkwon = Markwon.builder(mContext)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
@ -120,7 +123,7 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter<Message, Recycl
|
|||||||
@Override
|
@Override
|
||||||
public void afterSetText(@NonNull TextView textView) {
|
public void afterSetText(@NonNull TextView textView) {
|
||||||
textView.setHighlightColor(Color.TRANSPARENT);
|
textView.setHighlightColor(Color.TRANSPARENT);
|
||||||
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText().toString());
|
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText());
|
||||||
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
|
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
|
||||||
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
|
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
|
||||||
int start = 0;
|
int start = 0;
|
||||||
|
@ -73,7 +73,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.movement.MovementMethodPlugin;
|
import io.noties.markwon.movement.MovementMethodPlugin;
|
||||||
import io.noties.markwon.recycler.MarkwonAdapter;
|
import io.noties.markwon.recycler.MarkwonAdapter;
|
||||||
@ -226,7 +227,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
int postSpoilerBackgroundColor = markdownColor | 0xFF000000;
|
int postSpoilerBackgroundColor = markdownColor | 0xFF000000;
|
||||||
int linkColor = customThemeWrapper.getLinkColor();
|
int linkColor = customThemeWrapper.getLinkColor();
|
||||||
mPostDetailMarkwon = Markwon.builder(mActivity)
|
mPostDetailMarkwon = Markwon.builder(mActivity)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
@ -247,7 +250,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
@Override
|
@Override
|
||||||
public void afterSetText(@NonNull TextView textView) {
|
public void afterSetText(@NonNull TextView textView) {
|
||||||
textView.setHighlightColor(Color.TRANSPARENT);
|
textView.setHighlightColor(Color.TRANSPARENT);
|
||||||
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText().toString());
|
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText());
|
||||||
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
|
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
|
||||||
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
|
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
|
||||||
int start = 0;
|
int start = 0;
|
||||||
|
@ -27,7 +27,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
|
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
|
||||||
import ml.docilealligator.infinityforreddit.R;
|
import ml.docilealligator.infinityforreddit.R;
|
||||||
@ -66,7 +67,9 @@ public class PrivateMessagesDetailRecyclerViewAdapter extends RecyclerView.Adapt
|
|||||||
mLocale = locale;
|
mLocale = locale;
|
||||||
mAccountName = accountName;
|
mAccountName = accountName;
|
||||||
mMarkwon = Markwon.builder(viewPrivateMessagesActivity)
|
mMarkwon = Markwon.builder(viewPrivateMessagesActivity)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@Override
|
@Override
|
||||||
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
||||||
|
@ -22,7 +22,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.movement.MovementMethodPlugin;
|
import io.noties.markwon.movement.MovementMethodPlugin;
|
||||||
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
||||||
@ -40,7 +41,9 @@ public class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecycler
|
|||||||
|
|
||||||
public RulesRecyclerViewAdapter(AppCompatActivity activity, CustomThemeWrapper customThemeWrapper) {
|
public RulesRecyclerViewAdapter(AppCompatActivity activity, CustomThemeWrapper customThemeWrapper) {
|
||||||
markwon = Markwon.builder(activity)
|
markwon = Markwon.builder(activity)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@Override
|
@Override
|
||||||
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
public void configureConfiguration(@NonNull MarkwonConfiguration.Builder builder) {
|
||||||
|
@ -34,7 +34,8 @@ import io.noties.markwon.Markwon;
|
|||||||
import io.noties.markwon.MarkwonConfiguration;
|
import io.noties.markwon.MarkwonConfiguration;
|
||||||
import io.noties.markwon.core.MarkwonTheme;
|
import io.noties.markwon.core.MarkwonTheme;
|
||||||
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||||
import io.noties.markwon.html.HtmlPlugin;
|
import io.noties.markwon.inlineparser.HtmlInlineProcessor;
|
||||||
|
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin;
|
||||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||||
import io.noties.markwon.movement.MovementMethodPlugin;
|
import io.noties.markwon.movement.MovementMethodPlugin;
|
||||||
import io.noties.markwon.recycler.MarkwonAdapter;
|
import io.noties.markwon.recycler.MarkwonAdapter;
|
||||||
@ -104,7 +105,9 @@ public class SidebarFragment extends Fragment {
|
|||||||
markdownColor = mCustomThemeWrapper.getPrimaryTextColor();
|
markdownColor = mCustomThemeWrapper.getPrimaryTextColor();
|
||||||
|
|
||||||
Markwon markwon = Markwon.builder(activity)
|
Markwon markwon = Markwon.builder(activity)
|
||||||
.usePlugin(HtmlPlugin.create())
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
|
}))
|
||||||
.usePlugin(new AbstractMarkwonPlugin() {
|
.usePlugin(new AbstractMarkwonPlugin() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user