diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/source/Format.kt b/aztec/src/main/kotlin/org/wordpress/aztec/source/Format.kt index 3ce74a33f..057d9688e 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/source/Format.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/source/Format.kt @@ -5,6 +5,7 @@ import android.text.SpannableStringBuilder import android.text.TextUtils import org.jsoup.Jsoup import org.jsoup.nodes.Document +import org.jsoup.nodes.Element import org.wordpress.aztec.spans.AztecQuoteSpan import org.wordpress.aztec.spans.AztecVisualLinebreak import org.wordpress.aztec.spans.EndOfParagraphMarker @@ -30,9 +31,9 @@ object Format { CleaningUtils.cleanNestedBoldTags(doc) if (isCalypsoFormat) { // remove empty span tags - doc.select("*") - .filter { !it.hasText() && it.tagName() == "span" && it.childNodes().size == 0 } - .forEach { it.remove() } + doc.select("*").filter { element: Element -> + !element.hasText() && element.tagName() == "span" && element.childNodes().size == 0 + }.forEach { it.remove() } html = replaceAll(doc.body().html(), iframePlaceholder, "iframe") diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/util/CleaningUtils.kt b/aztec/src/main/kotlin/org/wordpress/aztec/util/CleaningUtils.kt index 9ae74ebe9..ff37acfb8 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/util/CleaningUtils.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/util/CleaningUtils.kt @@ -2,6 +2,7 @@ package org.wordpress.aztec.util import org.jsoup.Jsoup import org.jsoup.nodes.Document +import org.jsoup.nodes.Element import org.jsoup.parser.Parser object CleaningUtils { @@ -10,12 +11,12 @@ object CleaningUtils { fun cleanNestedBoldTags(doc: Document) { // clean all nested tags that don't contain anything doc.select("b > b") - .filter { !it.hasText() } + .filter { element: Element -> !element.hasText() } .forEach { it.remove() } // unwrap text in between nested tags that have some text in them doc.select("b > b") - .filter { it.hasText() } + .filter { element: Element -> element.hasText() } .forEach { it.unwrap() } } @@ -25,4 +26,4 @@ object CleaningUtils { cleanNestedBoldTags(doc) return doc.html() } -} \ No newline at end of file +} diff --git a/build.gradle b/build.gradle index 4f3f2ac08..1b93073cb 100644 --- a/build.gradle +++ b/build.gradle @@ -79,7 +79,7 @@ ext { picassoVersion = '2.5.2' robolectricVersion = '4.11' jUnitVersion = '4.12' - jSoupVersion = '1.11.3' + jSoupVersion = '1.15.3' wordpressUtilsVersion = '3.5.0' espressoVersion = '3.0.1'