Skip to content

Commit

Permalink
Added logging
Browse files Browse the repository at this point in the history
  • Loading branch information
marecar3 committed Nov 22, 2019
1 parent ace67ba commit 4cbd279
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
}

open fun shouldSkipTidying(): Boolean {
return false
return true
}

override fun afterTextChanged(text: Editable) {
Expand Down Expand Up @@ -1199,10 +1199,15 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown

var cleanSource = CleaningUtils.cleanNestedBoldTags(source)
cleanSource = Format.removeSourceEditorFormatting(cleanSource, isInCalypsoMode, isInGutenbergMode)
builder.append(parser.fromHtml(cleanSource, context, shouldSkipTidying()))
var returned = parser.fromHtml(cleanSource, context, shouldSkipTidying())
builder.append(returned)

var lengt3 = builder.length

Format.preProcessSpannedText(builder, isInCalypsoMode)

var lengt2 = builder.length

switchToAztecStyle(builder, 0, builder.length)
disableTextChangedListener()

Expand All @@ -1213,9 +1218,15 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
val cursorPosition = consumeCursorPosition(builder)
setSelection(0)

var lengt4 = builder.length

setTextKeepState(builder)
enableTextChangedListener()

var length = text.length

var lastIndex = text.lastIndexOf(Constants.ZWJ_CHAR, length-1)

setSelection(cursorPosition)

if (isInit) {
Expand Down Expand Up @@ -1323,6 +1334,17 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
// platform agnostic HTML
// default behavior returns HTML from this text
fun toPlainHtml(withCursorTag: Boolean = false): String {
var length = text.length
var lenth2 = text.toString().length

//println("ivasavic index " + lenth2)
for (j in 0 until lenth2) {
print("index " + j)
//print(" decimal: " + text.toString().get(j))
print(" char: " + text.toString().get(j).toInt())
println("")
}

return toPlainHtml(text, withCursorTag)
}

Expand Down

0 comments on commit 4cbd279

Please sign in to comment.