changed DocumentParser.kt

This commit is contained in:
bharath2547 2020-08-24 18:24:51 +05:30
parent 24147280c9
commit 33e90cd844

View File

@ -51,15 +51,11 @@ public class DocumentParser(private var listener: DocumentParser.SectionsListene
title = sectionTitle.trim() title = sectionTitle.trim()
return return
} }
sections.add(DocumentSection().apply {
val section = DocumentSection() this.id = id
section.title = section.title.trim(); title = sectionTitle.trim()
section.id = id; level = element.takeLast(element.length - 1).toIntOrNull() ?: 0
val character: String = element.substring(element.length - 1) })
val level = character.toIntOrNull() ?: 0
section.level = level
sections.add(section)
} }
@JavascriptInterface @JavascriptInterface