File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
wordpress-shortcodes/src/main/java/org/wordpress/aztec/plugins/shortcodes/extensions Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,12 @@ fun AztecText.removeImageCaption(attributePredicate: AztecText.AttributePredicat
4545
4646fun AztecText.hasImageCaption (attributePredicate : AztecText .AttributePredicate ): Boolean {
4747 this .text.getSpans(0 , this .text.length, AztecImageSpan ::class .java)
48- .firstOrNull {
49- val wrapper = SpanWrapper <AztecImageSpan >(text, it)
50- return text.getSpans(wrapper.start, wrapper.end, CaptionShortcodeSpan ::class .java)
51- .map { span -> span as CaptionShortcodeSpan }
52- .any { span -> attributePredicate.matches(span.attributes) }
48+ .firstOrNull {
49+ attributePredicate.matches(it.attributes)
50+ }
51+ ?.let {
52+ val wrapper = SpanWrapper (text, it)
53+ return text.getSpans(wrapper.start, wrapper.end, CaptionShortcodeSpan ::class .java).isNotEmpty()
5354 }
5455
5556 return false
You can’t perform that action at this time.
0 commit comments