Skip to content

Commit 608c9f2

Browse files
authored
Merge pull request #811 from wordpress-mobile/release/1.3.25
Merge Release/1.3.25 into master
2 parents 40cde2f + b4c079b commit 608c9f2

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Changelog
2+
## [v1.3.25](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.25)
3+
### Changed
4+
- Remove some unneeded logging #806
5+
### Fixed
6+
- Don't bail when ZWJ cleanup found end-of-text marker #807
7+
- Prevent execution of InputFilter for new lines #809
8+
29
## [v1.3.24](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.24)
310
### Changed
411
- Improvement to how clickable URL spans are handled #793

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ repositories {
105105
```
106106
```gradle
107107
dependencies {
108-
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.24')
108+
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.25')
109109
}
110110
```
111111

aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,9 @@ class AztecParser @JvmOverloads constructor(val plugins: List<IAztecPlugin> = li
335335
do {
336336
lastIndex = text.lastIndexOf(Constants.ZWJ_CHAR, lastIndex)
337337
if (lastIndex == text.length - 1) {
338-
// ZWJ at the end of text will serve as end-of-text marker so, let it be and finish.
339-
return
338+
// ZWJ at the end of text will serve as end-of-text marker so, let it be and continue cleaning up ZWJs
339+
lastIndex--
340+
continue
340341
}
341342

342343
if (lastIndex > -1) {

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,11 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
462462
// https://android-review.googlesource.com/c/platform/frameworks/base/+/634929
463463
val dynamicLayoutCrashPreventer = InputFilter { source, start, end, dest, dstart, dend ->
464464
var temp : CharSequence? = null
465-
if (!bypassCrashPreventerInputFilter && dstart == dend && dest.length > dend+1) {
465+
if (!bypassCrashPreventerInputFilter
466+
&& dstart == dend && dest.length > dend+1
467+
&& source != Constants.NEWLINE_STRING) {
466468
// dstart == dend means this is an insertion
469+
// avoid handling anything if it's a newline
467470
// if there are any images right after the destination position, hack the text
468471
val spans = dest.getSpans(dstart, dend+1, AztecImageSpan::class.java)
469472
if (spans.isNotEmpty()) {

aztec/src/main/kotlin/org/wordpress/aztec/watchers/event/sequence/UserOperationEvent.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.wordpress.aztec.watchers.event.sequence
22

3-
import org.wordpress.android.util.AppLog
43
import org.wordpress.aztec.spans.AztecCodeSpan
54
import org.wordpress.aztec.spans.AztecHeadingSpan
65
import org.wordpress.aztec.spans.AztecListItemSpan
@@ -78,9 +77,6 @@ abstract class UserOperationEvent(var sequence: EventSequence<TextWatcherEvent>
7877
insideHeading = false
7978
}
8079

81-
AppLog.d(AppLog.T.EDITOR, "SEQUENCE OBSERVED COMPLETELY, IS IT WITHIN BLOCK?: " +
82-
(isInsideList || insideHeading || isInsidePre || isInsideCode))
83-
8480
return isInsideList || insideHeading || isInsidePre || isInsideCode
8581
}
8682

aztec/src/main/kotlin/org/wordpress/aztec/watchers/event/sequence/known/space/steps/TextWatcherEventInsertTextDelAfter.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.wordpress.aztec.watchers.event.sequence.known.space.steps
22

3-
import org.wordpress.android.util.AppLog
43
import org.wordpress.aztec.watchers.EndOfBufferMarkerAdder
54
import org.wordpress.aztec.watchers.event.text.AfterTextChangedEventData
65
import org.wordpress.aztec.watchers.event.text.BeforeTextChangedEventData
@@ -18,17 +17,14 @@ class TextWatcherEventInsertTextDelAfter(beforeEventData: BeforeTextChangedEvent
1817

1918
private fun testBeforeTextChangedEventData(data: BeforeTextChangedEventData): Boolean {
2019
beforeText = data.textBefore
21-
AppLog.d(AppLog.T.EDITOR, "INSERTSPECIAL testBeforeTextChangedEventData: " + (data.count == 0 && data.after > 0))
2220
return data.count == 0 && data.after > 0
2321
}
2422

2523
private fun testOnTextChangedEventData(data: OnTextChangedEventData): Boolean {
26-
AppLog.d(AppLog.T.EDITOR, "INSERTSPECIAL testOnTextChangedEventData: " + (data.start >= 0 && data.count > 0 && data.textOn!!.length > 0))
2724
return data.start >= 0 && data.count > 0 && data.textOn!!.length > 0
2825
}
2926

3027
private fun testAfterTextChangedEventData(data: AfterTextChangedEventData): Boolean {
31-
AppLog.d(AppLog.T.EDITOR, "INSERTSPECIAL testAfterTextChangedEventData: " + (EndOfBufferMarkerAdder.safeLength(beforeText!!) == EndOfBufferMarkerAdder.safeLength(data.textAfter!!)))
3228
return EndOfBufferMarkerAdder.safeLength(beforeText!!) == EndOfBufferMarkerAdder.safeLength(data.textAfter!!)
3329
}
3430

0 commit comments

Comments
 (0)