Skip to content

Commit

Permalink
Update regex to determine if a URL is absolute URL
Browse files Browse the repository at this point in the history
Copied this regex from the readability.js
  • Loading branch information
msasikanth committed Jan 10, 2024
1 parent f3ff6ed commit c12fbb4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class FeedParser(private val dispatchersProvider: DispatchersProvider) {
}

private fun isAbsoluteUrl(url: String): Boolean {
val pattern = """^(?:\w+:)?//""".toRegex()
val pattern = """^[a-zA-Z][a-zA-Z0-9\+\-\.]*:""".toRegex()
return pattern.containsMatchIn(url)
}
}
Expand Down

0 comments on commit c12fbb4

Please sign in to comment.