Skip to content

Commit bdd9858

Browse files
authored
Merge pull request #1089 from wordpress-mobile/bump_jsoup_1_15_3
Bump jsoup to 1.15.3
2 parents 2d66175 + 5bee1c9 commit bdd9858

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/source/Format.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.text.SpannableStringBuilder
55
import android.text.TextUtils
66
import org.jsoup.Jsoup
77
import org.jsoup.nodes.Document
8+
import org.jsoup.nodes.Element
89
import org.wordpress.aztec.spans.AztecQuoteSpan
910
import org.wordpress.aztec.spans.AztecVisualLinebreak
1011
import org.wordpress.aztec.spans.EndOfParagraphMarker
@@ -30,9 +31,9 @@ object Format {
3031
CleaningUtils.cleanNestedBoldTags(doc)
3132
if (isCalypsoFormat) {
3233
// remove empty span tags
33-
doc.select("*")
34-
.filter { !it.hasText() && it.tagName() == "span" && it.childNodes().size == 0 }
35-
.forEach { it.remove() }
34+
doc.select("*").filter { element: Element ->
35+
!element.hasText() && element.tagName() == "span" && element.childNodes().size == 0
36+
}.forEach { it.remove() }
3637

3738
html = replaceAll(doc.body().html(), iframePlaceholder, "iframe")
3839

aztec/src/main/kotlin/org/wordpress/aztec/util/CleaningUtils.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.wordpress.aztec.util
22

33
import org.jsoup.Jsoup
44
import org.jsoup.nodes.Document
5+
import org.jsoup.nodes.Element
56
import org.jsoup.parser.Parser
67

78
object CleaningUtils {
@@ -10,12 +11,12 @@ object CleaningUtils {
1011
fun cleanNestedBoldTags(doc: Document) {
1112
// clean all nested <b> tags that don't contain anything
1213
doc.select("b > b")
13-
.filter { !it.hasText() }
14+
.filter { element: Element -> !element.hasText() }
1415
.forEach { it.remove() }
1516

1617
// unwrap text in between nested <b> tags that have some text in them
1718
doc.select("b > b")
18-
.filter { it.hasText() }
19+
.filter { element: Element -> element.hasText() }
1920
.forEach { it.unwrap() }
2021
}
2122

@@ -25,4 +26,4 @@ object CleaningUtils {
2526
cleanNestedBoldTags(doc)
2627
return doc.html()
2728
}
28-
}
29+
}

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ext {
7979
picassoVersion = '2.5.2'
8080
robolectricVersion = '4.11'
8181
jUnitVersion = '4.12'
82-
jSoupVersion = '1.11.3'
82+
jSoupVersion = '1.15.3'
8383
wordpressUtilsVersion = '3.5.0'
8484
espressoVersion = '3.0.1'
8585

0 commit comments

Comments
 (0)