Skip to content

Commit

Permalink
Change regex to <br/?>
Browse files Browse the repository at this point in the history
  • Loading branch information
layou233 committed Jan 3, 2021
1 parent e65c453 commit 1ad2f3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/lau/NovelDL/NovelHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.lang.NullPointerException
fun readNovel(plain: String): String {
// Get the main part of the novel
val novelStart: Int = plain.indexOf("<divid=\"content\"")
if (novelStart == -1) throw NullPointerException("Not novel");
if (novelStart == -1) throw NullPointerException("Not novel")
var novel: String = plain.substring(
plain.indexOf('>', novelStart) + 1,
plain.indexOf("</div>", novelStart)
Expand All @@ -24,7 +24,7 @@ fun readNovel(plain: String): String {
novel = Regex("&quot;").replace(novel, "\"")

// Process "</br>"s
novel = Regex("<br/>").replace(novel, "\n")
novel = Regex("<br/?>").replace(novel, "\n")

// Remove "<a href=url></a>"s
novel = removePartsFromString(novel, "<ahref", "</a>", "")
Expand Down

0 comments on commit 1ad2f3e

Please sign in to comment.