File tree 3 files changed +9
-7
lines changed
aztec/src/main/kotlin/org/wordpress/aztec
3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import android.text.SpannableStringBuilder
5
5
import android.text.TextUtils
6
6
import org.jsoup.Jsoup
7
7
import org.jsoup.nodes.Document
8
+ import org.jsoup.nodes.Element
8
9
import org.wordpress.aztec.spans.AztecQuoteSpan
9
10
import org.wordpress.aztec.spans.AztecVisualLinebreak
10
11
import org.wordpress.aztec.spans.EndOfParagraphMarker
@@ -30,9 +31,9 @@ object Format {
30
31
CleaningUtils .cleanNestedBoldTags(doc)
31
32
if (isCalypsoFormat) {
32
33
// 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() }
36
37
37
38
html = replaceAll(doc.body().html(), iframePlaceholder, " iframe" )
38
39
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.wordpress.aztec.util
2
2
3
3
import org.jsoup.Jsoup
4
4
import org.jsoup.nodes.Document
5
+ import org.jsoup.nodes.Element
5
6
import org.jsoup.parser.Parser
6
7
7
8
object CleaningUtils {
@@ -10,12 +11,12 @@ object CleaningUtils {
10
11
fun cleanNestedBoldTags (doc : Document ) {
11
12
// clean all nested <b> tags that don't contain anything
12
13
doc.select(" b > b" )
13
- .filter { ! it .hasText() }
14
+ .filter { element : Element -> ! element .hasText() }
14
15
.forEach { it.remove() }
15
16
16
17
// unwrap text in between nested <b> tags that have some text in them
17
18
doc.select(" b > b" )
18
- .filter { it .hasText() }
19
+ .filter { element : Element -> element .hasText() }
19
20
.forEach { it.unwrap() }
20
21
}
21
22
@@ -25,4 +26,4 @@ object CleaningUtils {
25
26
cleanNestedBoldTags(doc)
26
27
return doc.html()
27
28
}
28
- }
29
+ }
Original file line number Diff line number Diff line change 79
79
picassoVersion = ' 2.5.2'
80
80
robolectricVersion = ' 4.11'
81
81
jUnitVersion = ' 4.12'
82
- jSoupVersion = ' 1.11 .3'
82
+ jSoupVersion = ' 1.15 .3'
83
83
wordpressUtilsVersion = ' 3.5.0'
84
84
espressoVersion = ' 3.0.1'
85
85
You can’t perform that action at this time.
0 commit comments