diff --git a/src/main/kotlin/internal/svs/VariablePageContent.kt b/src/main/kotlin/internal/svs/VariablePageContent.kt index a8ff840..c54698e 100644 --- a/src/main/kotlin/internal/svs/VariablePageContent.kt +++ b/src/main/kotlin/internal/svs/VariablePageContent.kt @@ -32,10 +32,12 @@ data class VariablePageContent( private fun Element.asQuestion(): Question { val spanAttribute = "data-en" return Question( - period = select("td:eq(0) span[$spanAttribute]").attr(spanAttribute), - instrument = select("td:eq(1) span[$spanAttribute]").attr(spanAttribute), - text = select("td:eq(2) span[$spanAttribute]").attr(spanAttribute), + period = select("td:eq(0) span[$spanAttribute]").attr(spanAttribute).sanitise(), + instrument = select("td:eq(1) span[$spanAttribute]").attr(spanAttribute).sanitise(), + text = select("td:eq(2) span[$spanAttribute]").attr(spanAttribute).sanitise(), referenceUrl = URL(PANEL_DATA_SITE_DOMAIN + select("td:eq(2) a").attr("href")) ) } + + private fun String.sanitise() = lines().joinToString().trim() }