Skip to content

Commit f44e08e

Browse files
committed
Fixed issue with quote.
1 parent 528954f commit f44e08e

File tree

1 file changed

+9
-3
lines changed
  • aztec/src/main/kotlin/org/wordpress/aztec/source

1 file changed

+9
-3
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/source/Format.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ object Format {
329329
text.setSpan(EndOfParagraphMarker(), spanEnd, spanEnd + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
330330
}
331331
}
332+
333+
//we don't need paragraph spans in calypso at this point
334+
text.getSpans(0,text.length, ParagraphSpan::class.java).forEach {
335+
text.removeSpan(it)
336+
}
332337
}
333338
}
334339

@@ -343,14 +348,15 @@ object Format {
343348
val spanStart = text.getSpanStart(it)
344349
val spanEnd = text.getSpanEnd(it)
345350

346-
if (text[spanStart] == '\n' && text.getSpans(spanEnd, spanEnd + 1, AztecParagraphStyle::class.java).filter { it !is ParagraphSpan }.isEmpty()) {
351+
if (text[spanStart] == '\n' && text.getSpans(spanEnd, spanEnd + 1, AztecParagraphStyle::class.java)
352+
.filter { it !is ParagraphSpan && text.getSpanStart(it) == spanEnd }.isEmpty()) {
347353
text.insert(spanEnd, "\n")
348354
}
349355

350-
if (text.getSpans(spanStart, spanEnd, AztecQuoteSpan::class.java).isEmpty()) {
356+
if (text.getSpans(spanStart, spanEnd, AztecQuoteSpan::class.java)
357+
.filter { text.getSpanEnd(it) == spanEnd }.isEmpty()) {
351358
text.getSpans(spanStart, spanEnd, AztecVisualLinebreak::class.java).forEach { text.removeSpan(it) }
352359
}
353-
354360
}
355361

356362
//we don't care about actual ParagraphSpan in calypso - paragraphs are made from double newline

0 commit comments

Comments
 (0)