mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-28 11:58:23 +01:00
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 !<
This commit is contained in:
parent
839325efbe
commit
ef1bdf2fa5
@ -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("((?<=[\\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("\\^{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 ")
|
.replaceAll("(^|^ *|\\n *)##(?!($|\\s|#))", "$0 ")
|
||||||
.replaceAll("(^|^ *|\\n *)###(?!($|\\s|#))", "$0 ")
|
.replaceAll("(^|^ *|\\n *)###(?!($|\\s|#))", "$0 ")
|
||||||
|
Loading…
Reference in New Issue
Block a user