diff options
author | scria1000 <91804886+scria1000@users.noreply.github.com> | 2021-11-14 13:34:50 +0000 |
---|---|---|
committer | scria1000 <91804886+scria1000@users.noreply.github.com> | 2021-11-14 13:34:50 +0000 |
commit | ef1bdf2fa5fa4505e609b0862d9c7ed01659da38 (patch) | |
tree | 49a865a61b3a59e1c4ba9e2cb90f1ab4481c7cd7 /app/src/main/java/ml/docilealligator/infinityforreddit | |
parent | 839325efbedb108917b37353c9493fea305d71e2 (diff) | |
download | infinity-for-reddit-ef1bdf2fa5fa4505e609b0862d9c7ed01659da38.tar infinity-for-reddit-ef1bdf2fa5fa4505e609b0862d9c7ed01659da38.tar.gz infinity-for-reddit-ef1bdf2fa5fa4505e609b0862d9c7ed01659da38.tar.bz2 infinity-for-reddit-ef1bdf2fa5fa4505e609b0862d9c7ed01659da38.tar.lz infinity-for-reddit-ef1bdf2fa5fa4505e609b0862d9c7ed01659da38.tar.xz infinity-for-reddit-ef1bdf2fa5fa4505e609b0862d9c7ed01659da38.tar.zst infinity-for-reddit-ef1bdf2fa5fa4505e609b0862d9c7ed01659da38.zip |
Optimize spoiler regex
Optimize spoiler regex to allow at least one new line.
>!
match this!<
>!match
this!<
>!
match this!<
>!don't
match
this<!
>!
match this
!<
>!match
this
!<
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java index 0b49ba31..525dfa2a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java @@ -65,7 +65,7 @@ public class Utils { .replaceAll("((?<=[\\s])|^)/[rRuU]/[\\w-]+/{0,1}", "[$0](https://www.reddit.com$0)") .replaceAll("((?<=[\\s])|^)[rRuU]/[\\w-]+/{0,1}", "[$0](https://www.reddit.com/$0)") .replaceAll("\\^{2,}", "^") - .replaceAll(">!", ">!") // If it's in a code block, html entity remains escaped + .replaceAll("(?:>!)(\\n?[\\S\\h]+?\\n?[\\S\\h]+\\n?!<)", ">!$1") // html entity remains escaped inside an inline block .replaceAll("(^|^ *|\\n *)#(?!($|\\s|#))", "$0 ") .replaceAll("(^|^ *|\\n *)##(?!($|\\s|#))", "$0 ") .replaceAll("(^|^ *|\\n *)###(?!($|\\s|#))", "$0 ") |