AGPL-3.0-only, a source link in the app, and everything on dev since #5 #6
@@ -53,7 +53,12 @@ private val TRAILING_PUNCTUATION = charArrayOf('.', ',', ';', ':', '!', '?')
|
|||||||
* both run the `urls` cases in `core/testdata/grammar.json` (here, by hand).
|
* both run the `urls` cases in `core/testdata/grammar.json` (here, by hand).
|
||||||
*/
|
*/
|
||||||
fun loneUrl(body: String): String? =
|
fun loneUrl(body: String): String? =
|
||||||
LONE_URL.matchEntire(body)?.groupValues?.get(1)?.trimEnd(*TRAILING_PUNCTUATION)?.ifEmpty { null }
|
LONE_URL
|
||||||
|
.matchEntire(body)
|
||||||
|
?.groupValues
|
||||||
|
?.get(1)
|
||||||
|
?.trimEnd(*TRAILING_PUNCTUATION)
|
||||||
|
?.ifEmpty { null }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The preview for a note that is nothing but a URL, or null.
|
* The preview for a note that is nothing but a URL, or null.
|
||||||
|
|||||||
Reference in New Issue
Block a user