mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
Revert changes made in refactor
We need the original superscript markdown for when we edit posts!
This commit is contained in:
parent
a52342b336
commit
550706d2d7
@ -177,7 +177,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -231,7 +231,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,7 +148,7 @@ public class FullMarkdownActivity extends BaseActivity {
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -173,7 +173,7 @@ public class WikiActivity extends BaseActivity {
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -133,7 +133,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -178,7 +178,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -117,7 +117,7 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter<Message, Recycl
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -243,7 +243,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -83,7 +83,7 @@ public class PrivateMessagesDetailRecyclerViewAdapter extends RecyclerView.Adapt
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +58,7 @@ public class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecycler
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,7 +122,7 @@ public class SidebarFragment extends Fragment {
|
||||
@NonNull
|
||||
@Override
|
||||
public String processMarkdown(@NonNull String markdown) {
|
||||
return super.processMarkdown(markdown);
|
||||
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -73,10 +73,13 @@ public class Utils {
|
||||
.replaceAll("(^|^ *|\\n *)#####(?!($|\\s|#))", "$0 ")
|
||||
.replaceAll("(^|^ *|\\n *)######(?!($|\\s|#))", "$0 "));
|
||||
|
||||
return fixSuperScript(regexed);
|
||||
//return fixSuperScript(regexed);
|
||||
// We don't want to fix super scripts here because we need the original markdown later for editing posts
|
||||
return regexed.toString();
|
||||
}
|
||||
|
||||
private static String fixSuperScript(StringBuilder regexed) {
|
||||
public static String fixSuperScript(String regexedMarkdown) {
|
||||
StringBuilder regexed = new StringBuilder(regexedMarkdown);
|
||||
boolean hasBracket = false;
|
||||
int nCarets = 0;
|
||||
for (int i = 0; i < regexed.length(); i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user