Skip to content

Commit

Permalink
Merge pull request #811 from wordpress-mobile/release/1.3.25
Browse files Browse the repository at this point in the history
Merge Release/1.3.25 into master
  • Loading branch information
jtreanor authored Apr 16, 2019
2 parents 40cde2f + b4c079b commit 608c9f2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Changelog
## [v1.3.25](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.25)
### Changed
- Remove some unneeded logging #806
### Fixed
- Don't bail when ZWJ cleanup found end-of-text marker #807
- Prevent execution of InputFilter for new lines #809

## [v1.3.24](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.24)
### Changed
- Improvement to how clickable URL spans are handled #793
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ repositories {
```
```gradle
dependencies {
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.24')
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.25')
}
```

Expand Down
5 changes: 3 additions & 2 deletions aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ class AztecParser @JvmOverloads constructor(val plugins: List<IAztecPlugin> = li
do {
lastIndex = text.lastIndexOf(Constants.ZWJ_CHAR, lastIndex)
if (lastIndex == text.length - 1) {
// ZWJ at the end of text will serve as end-of-text marker so, let it be and finish.
return
// ZWJ at the end of text will serve as end-of-text marker so, let it be and continue cleaning up ZWJs
lastIndex--
continue
}

if (lastIndex > -1) {
Expand Down
5 changes: 4 additions & 1 deletion aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,11 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
// https://android-review.googlesource.com/c/platform/frameworks/base/+/634929
val dynamicLayoutCrashPreventer = InputFilter { source, start, end, dest, dstart, dend ->
var temp : CharSequence? = null
if (!bypassCrashPreventerInputFilter && dstart == dend && dest.length > dend+1) {
if (!bypassCrashPreventerInputFilter
&& dstart == dend && dest.length > dend+1
&& source != Constants.NEWLINE_STRING) {
// dstart == dend means this is an insertion
// avoid handling anything if it's a newline
// if there are any images right after the destination position, hack the text
val spans = dest.getSpans(dstart, dend+1, AztecImageSpan::class.java)
if (spans.isNotEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.wordpress.aztec.watchers.event.sequence

import org.wordpress.android.util.AppLog
import org.wordpress.aztec.spans.AztecCodeSpan
import org.wordpress.aztec.spans.AztecHeadingSpan
import org.wordpress.aztec.spans.AztecListItemSpan
Expand Down Expand Up @@ -78,9 +77,6 @@ abstract class UserOperationEvent(var sequence: EventSequence<TextWatcherEvent>
insideHeading = false
}

AppLog.d(AppLog.T.EDITOR, "SEQUENCE OBSERVED COMPLETELY, IS IT WITHIN BLOCK?: " +
(isInsideList || insideHeading || isInsidePre || isInsideCode))

return isInsideList || insideHeading || isInsidePre || isInsideCode
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.wordpress.aztec.watchers.event.sequence.known.space.steps

import org.wordpress.android.util.AppLog
import org.wordpress.aztec.watchers.EndOfBufferMarkerAdder
import org.wordpress.aztec.watchers.event.text.AfterTextChangedEventData
import org.wordpress.aztec.watchers.event.text.BeforeTextChangedEventData
Expand All @@ -18,17 +17,14 @@ class TextWatcherEventInsertTextDelAfter(beforeEventData: BeforeTextChangedEvent

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

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

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

Expand Down

0 comments on commit 608c9f2

Please sign in to comment.