Merge pull request #525 from scria1000/comment-markdown-fix

Fix markdown not rendering in some comments
This commit is contained in:
Docile-Alligator 2021-11-11 20:33:37 +08:00 committed by GitHub
commit 4bd6ae0c4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
@Override
public void afterSetText(@NonNull TextView textView) {
textView.setHighlightColor(Color.TRANSPARENT);
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText().toString());
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText());
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
int start = 0;

View File

@ -180,7 +180,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
@Override
public void afterSetText(@NonNull TextView textView) {
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText().toString());
SpannableStringBuilder markdownStringBuilder = new SpannableStringBuilder(textView.getText());
Pattern spoilerPattern = Pattern.compile(">![\\S\\s]+?!<");
Matcher matcher = spoilerPattern.matcher(markdownStringBuilder);
int start = 0;