We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51a4c31 commit 9d25e1fCopy full SHA for 9d25e1f
wordpress-shortcodes/src/main/java/org/wordpress/aztec/plugins/shortcodes/extensions/CaptionExtensions.kt
@@ -47,7 +47,9 @@ fun AztecText.hasImageCaption(attributePredicate: AztecText.AttributePredicate):
47
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).isNotEmpty()
+ return text.getSpans(wrapper.start, wrapper.end, CaptionShortcodeSpan::class.java)
51
+ .map { span -> span as CaptionShortcodeSpan }
52
+ .any { span -> attributePredicate.matches(span.attributes) }
53
}
54
55
return false
0 commit comments