mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-14 06:22:50 +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
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -231,7 +231,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -148,7 +148,7 @@ public class FullMarkdownActivity extends BaseActivity {
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -173,7 +173,7 @@ public class WikiActivity extends BaseActivity {
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -133,7 +133,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -178,7 +178,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -117,7 +117,7 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter<Message, Recycl
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -243,7 +243,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -83,7 +83,7 @@ public class PrivateMessagesDetailRecyclerViewAdapter extends RecyclerView.Adapt
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -58,7 +58,7 @@ public class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecycler
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -122,7 +122,7 @@ public class SidebarFragment extends Fragment {
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String processMarkdown(@NonNull String markdown) {
|
public String processMarkdown(@NonNull String markdown) {
|
||||||
return super.processMarkdown(markdown);
|
return super.processMarkdown(Utils.fixSuperScript(markdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -73,10 +73,13 @@ public class Utils {
|
|||||||
.replaceAll("(^|^ *|\\n *)#####(?!($|\\s|#))", "$0 ")
|
.replaceAll("(^|^ *|\\n *)#####(?!($|\\s|#))", "$0 ")
|
||||||
.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;
|
boolean hasBracket = false;
|
||||||
int nCarets = 0;
|
int nCarets = 0;
|
||||||
for (int i = 0; i < regexed.length(); i++) {
|
for (int i = 0; i < regexed.length(); i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user