|
|
@ -33,7 +33,7 @@ fun String?.isJsonArray(): Boolean = |
|
|
|
} ?: false |
|
|
|
} ?: false |
|
|
|
|
|
|
|
|
|
|
|
fun String?.htmlFormat(): String = |
|
|
|
fun String?.htmlFormat(): String = |
|
|
|
this?.replace("(?i)<(br[\\s/]*|/*p\\b.*?|/*div\\b.*?)>".toRegex(), "\n") |
|
|
|
this?.replace("</?(?:div|p|b|br|hr|h\\d|article|dd|dl|span)[^>]*>".toRegex(), "\n") |
|
|
|
?.replace("<[script>]*.*?>| ".toRegex(), "") |
|
|
|
?.replace("<[script>]*.*?>| ".toRegex(), "") |
|
|
|
?.replace("\\s*\\n+\\s*".toRegex(), "\n ") |
|
|
|
?.replace("\\s*\\n+\\s*".toRegex(), "\n ") |
|
|
|
?.replace("^[\\n\\s]+".toRegex(), " ") |
|
|
|
?.replace("^[\\n\\s]+".toRegex(), " ") |
|
|
|