File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
aztec/src/main/kotlin/org/wordpress/aztec Expand file tree Collapse file tree 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
55import android.text.TextUtils
66import org.jsoup.Jsoup
77import org.jsoup.nodes.Document
8+ import org.jsoup.nodes.Element
89import org.wordpress.aztec.spans.AztecQuoteSpan
910import org.wordpress.aztec.spans.AztecVisualLinebreak
1011import 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
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.wordpress.aztec.util
22
33import org.jsoup.Jsoup
44import org.jsoup.nodes.Document
5+ import org.jsoup.nodes.Element
56import org.jsoup.parser.Parser
67
78object 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+ }
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments