From f03661f7ee257370d0166907c0cdccef3e465fde Mon Sep 17 00:00:00 2001 From: Tugdual de Kerviler Date: Tue, 22 Jan 2019 09:47:03 +0100 Subject: [PATCH 1/8] Make em the default italic tag --- .../wordpress/aztec/spans/AztecStyleItalicSpan.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleItalicSpan.kt b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleItalicSpan.kt index 3037b3c22..61175625b 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleItalicSpan.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleItalicSpan.kt @@ -4,4 +4,15 @@ import android.graphics.Typeface import org.wordpress.aztec.AztecAttributes class AztecStyleItalicSpan(attributes: AztecAttributes = AztecAttributes()) - : AztecStyleSpan(Typeface.ITALIC, attributes) + : AztecStyleSpan(Typeface.ITALIC, attributes) { + + override val TAG by lazy { + when (style) { + Typeface.ITALIC -> { + return@lazy "em" + } + } + throw IllegalArgumentException() + } +} + From d2492a835555c658581f495838cd0e5ba76bdb0b Mon Sep 17 00:00:00 2001 From: Tugdual de Kerviler Date: Wed, 23 Jan 2019 13:23:30 +0100 Subject: [PATCH 2/8] Add new format FORMAT_EMPHASIS to handle tags --- .../main/java/org/wordpress/aztec/Html.java | 11 +++++++++-- .../kotlin/org/wordpress/aztec/AztecText.kt | 1 + .../org/wordpress/aztec/AztecTextFormat.kt | 1 + .../aztec/formatting/InlineFormatter.kt | 4 ++++ .../aztec/spans/AztecStyleEmphasisSpan.kt | 18 ++++++++++++++++++ .../aztec/spans/AztecStyleItalicSpan.kt | 13 +------------ 6 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleEmphasisSpan.kt diff --git a/aztec/src/main/java/org/wordpress/aztec/Html.java b/aztec/src/main/java/org/wordpress/aztec/Html.java index a4f3aaa8b..434ad16cf 100644 --- a/aztec/src/main/java/org/wordpress/aztec/Html.java +++ b/aztec/src/main/java/org/wordpress/aztec/Html.java @@ -46,6 +46,7 @@ import org.wordpress.aztec.spans.AztecStyleBoldSpan; import org.wordpress.aztec.spans.AztecStyleCiteSpan; import org.wordpress.aztec.spans.AztecStyleItalicSpan; +import org.wordpress.aztec.spans.AztecStyleEmphasisSpan; import org.wordpress.aztec.spans.AztecStyleStrongSpan; import org.wordpress.aztec.spans.AztecSubscriptSpan; import org.wordpress.aztec.spans.AztecSuperscriptSpan; @@ -318,7 +319,7 @@ private void handleStartTag(String tag, Attributes attributes, int nestingLevel) } else if (tag.equalsIgnoreCase("b")) { start(spannableStringBuilder, AztecTextFormat.FORMAT_BOLD, attributes); } else if (tag.equalsIgnoreCase("em")) { - start(spannableStringBuilder, AztecTextFormat.FORMAT_ITALIC, attributes); + start(spannableStringBuilder, AztecTextFormat.FORMAT_EMPHASIS, attributes); } else if (tag.equalsIgnoreCase("cite")) { start(spannableStringBuilder, AztecTextFormat.FORMAT_CITE, attributes); } else if (tag.equalsIgnoreCase("dfn")) { @@ -411,7 +412,7 @@ private void handleEndTag(String tag, int nestingLevel) { } else if (tag.equalsIgnoreCase("b")) { end(spannableStringBuilder, AztecTextFormat.FORMAT_BOLD); } else if (tag.equalsIgnoreCase("em")) { - end(spannableStringBuilder, AztecTextFormat.FORMAT_ITALIC); + end(spannableStringBuilder, AztecTextFormat.FORMAT_EMPHASIS); } else if (tag.equalsIgnoreCase("cite")) { end(spannableStringBuilder, AztecTextFormat.FORMAT_CITE); } else if (tag.equalsIgnoreCase("dfn")) { @@ -498,6 +499,9 @@ private static void start(SpannableStringBuilder text, AztecTextFormat textForma case FORMAT_ITALIC: newSpan = new AztecStyleItalicSpan(attributes); break; + case FORMAT_EMPHASIS: + newSpan = new AztecStyleEmphasisSpan(attributes); + break; case FORMAT_CITE: newSpan = new AztecStyleCiteSpan(attributes); break; @@ -550,6 +554,9 @@ private static void end(SpannableStringBuilder text, AztecTextFormat textFormat) case FORMAT_ITALIC: span = (AztecStyleItalicSpan) getLast(text, AztecStyleItalicSpan.class); break; + case FORMAT_EMPHASIS: + span = (AztecStyleEmphasisSpan) getLast(text, AztecStyleEmphasisSpan.class); + break; case FORMAT_CITE: span = (AztecStyleCiteSpan) getLast(text, AztecStyleCiteSpan.class); break; diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt index 27dd62c02..57fadbe92 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt @@ -923,6 +923,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown AztecTextFormat.FORMAT_HEADING_6, AztecTextFormat.FORMAT_PREFORMAT -> blockFormatter.toggleHeading(textFormat) AztecTextFormat.FORMAT_ITALIC, + AztecTextFormat.FORMAT_EMPHASIS, AztecTextFormat.FORMAT_CITE, AztecTextFormat.FORMAT_UNDERLINE, AztecTextFormat.FORMAT_STRIKETHROUGH, diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecTextFormat.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecTextFormat.kt index ce58a2aa1..2f0bb4bae 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecTextFormat.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecTextFormat.kt @@ -16,6 +16,7 @@ enum class AztecTextFormat : ITextFormat { FORMAT_BOLD, FORMAT_STRONG, FORMAT_ITALIC, + FORMAT_EMPHASIS, FORMAT_CITE, FORMAT_UNDERLINE, FORMAT_STRIKETHROUGH, diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/formatting/InlineFormatter.kt b/aztec/src/main/kotlin/org/wordpress/aztec/formatting/InlineFormatter.kt index 77c706db1..0f4f86f4c 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/formatting/InlineFormatter.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/formatting/InlineFormatter.kt @@ -16,6 +16,7 @@ import org.wordpress.aztec.spans.AztecStrikethroughSpan import org.wordpress.aztec.spans.AztecStyleBoldSpan import org.wordpress.aztec.spans.AztecStyleCiteSpan import org.wordpress.aztec.spans.AztecStyleItalicSpan +import org.wordpress.aztec.spans.AztecStyleEmphasisSpan import org.wordpress.aztec.spans.AztecStyleStrongSpan import org.wordpress.aztec.spans.AztecStyleSpan import org.wordpress.aztec.spans.AztecUnderlineSpan @@ -65,6 +66,7 @@ class InlineFormatter(editor: AztecText, val codeStyle: CodeStyle) : AztecFormat AztecTextFormat.FORMAT_BOLD, AztecTextFormat.FORMAT_STRONG, AztecTextFormat.FORMAT_ITALIC, + AztecTextFormat.FORMAT_EMPHASIS, AztecTextFormat.FORMAT_CITE, AztecTextFormat.FORMAT_STRIKETHROUGH, AztecTextFormat.FORMAT_UNDERLINE, @@ -198,6 +200,7 @@ class InlineFormatter(editor: AztecText, val codeStyle: CodeStyle) : AztecFormat AztecStyleBoldSpan::class.java -> return AztecTextFormat.FORMAT_BOLD AztecStyleStrongSpan::class.java -> return AztecTextFormat.FORMAT_STRONG AztecStyleItalicSpan::class.java -> return AztecTextFormat.FORMAT_ITALIC + AztecStyleEmphasisSpan::class.java -> return AztecTextFormat.FORMAT_EMPHASIS AztecStyleCiteSpan::class.java -> return AztecTextFormat.FORMAT_CITE AztecStrikethroughSpan::class.java -> return AztecTextFormat.FORMAT_STRIKETHROUGH AztecUnderlineSpan::class.java -> return AztecTextFormat.FORMAT_UNDERLINE @@ -341,6 +344,7 @@ class InlineFormatter(editor: AztecText, val codeStyle: CodeStyle) : AztecFormat AztecTextFormat.FORMAT_BOLD -> return AztecStyleBoldSpan() AztecTextFormat.FORMAT_STRONG -> return AztecStyleStrongSpan() AztecTextFormat.FORMAT_ITALIC -> return AztecStyleItalicSpan() + AztecTextFormat.FORMAT_EMPHASIS -> return AztecStyleEmphasisSpan() AztecTextFormat.FORMAT_CITE -> return AztecStyleCiteSpan() AztecTextFormat.FORMAT_STRIKETHROUGH -> return AztecStrikethroughSpan() AztecTextFormat.FORMAT_UNDERLINE -> return AztecUnderlineSpan() diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleEmphasisSpan.kt b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleEmphasisSpan.kt new file mode 100644 index 000000000..ac210a8d0 --- /dev/null +++ b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleEmphasisSpan.kt @@ -0,0 +1,18 @@ +package org.wordpress.aztec.spans + +import android.graphics.Typeface +import org.wordpress.aztec.AztecAttributes + +class AztecStyleEmphasisSpan(attributes: AztecAttributes = AztecAttributes()) + : AztecStyleSpan(Typeface.ITALIC, attributes) { + + override val TAG by lazy { + when (style) { + Typeface.ITALIC -> { + return@lazy "em" + } + } + throw IllegalArgumentException() + } +} + diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleItalicSpan.kt b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleItalicSpan.kt index 61175625b..3037b3c22 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleItalicSpan.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecStyleItalicSpan.kt @@ -4,15 +4,4 @@ import android.graphics.Typeface import org.wordpress.aztec.AztecAttributes class AztecStyleItalicSpan(attributes: AztecAttributes = AztecAttributes()) - : AztecStyleSpan(Typeface.ITALIC, attributes) { - - override val TAG by lazy { - when (style) { - Typeface.ITALIC -> { - return@lazy "em" - } - } - throw IllegalArgumentException() - } -} - + : AztecStyleSpan(Typeface.ITALIC, attributes) From 4cdad3518858e59951da65f902e6b3f0140bfd72 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Tue, 29 Jan 2019 17:55:42 +0200 Subject: [PATCH 3/8] Accept SDK licences on JitPack --- jitpack.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 jitpack.yml diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 000000000..a79c8ef03 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,4 @@ +before_install: + - yes | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27" + - yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;27.0.3" + From fc7c5eb5ef4f23a927e7707c4ba0f3d7aae174ae Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Fri, 1 Feb 2019 12:12:27 +0200 Subject: [PATCH 4/8] Also remove the EMPHASIS style --- aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt index 57fadbe92..a7d57c920 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt @@ -1359,6 +1359,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown inlineFormatter.removeInlineStyle(AztecTextFormat.FORMAT_BOLD, start, end) inlineFormatter.removeInlineStyle(AztecTextFormat.FORMAT_STRONG, start, end) inlineFormatter.removeInlineStyle(AztecTextFormat.FORMAT_ITALIC, start, end) + inlineFormatter.removeInlineStyle(AztecTextFormat.FORMAT_EMPHASIS, start, end) inlineFormatter.removeInlineStyle(AztecTextFormat.FORMAT_CITE, start, end) inlineFormatter.removeInlineStyle(AztecTextFormat.FORMAT_STRIKETHROUGH, start, end) inlineFormatter.removeInlineStyle(AztecTextFormat.FORMAT_UNDERLINE, start, end) From c0879223d6edd6c98b13e9abe3996cf5b8a24721 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 6 Feb 2019 16:47:33 +0200 Subject: [PATCH 5/8] Check for too --- aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt index 128994433..6bcb26ba0 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt @@ -958,6 +958,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown AztecTextFormat.FORMAT_BOLD, AztecTextFormat.FORMAT_STRONG, AztecTextFormat.FORMAT_ITALIC, + AztecTextFormat.FORMAT_EMPHASIS, AztecTextFormat.FORMAT_CITE, AztecTextFormat.FORMAT_UNDERLINE, AztecTextFormat.FORMAT_STRIKETHROUGH, From 84837261db28b1f7fb1ad5e6b9706c0907067da1 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 6 Feb 2019 17:42:35 +0200 Subject: [PATCH 6/8] Make the default for italic --- .../wordpress/aztec/toolbar/AztecToolbar.kt | 2 +- .../wordpress/aztec/toolbar/ToolbarAction.kt | 2 +- .../org/wordpress/aztec/AztecToolbarTest.kt | 48 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt b/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt index 0aaf93aad..d9014c309 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt @@ -182,7 +182,7 @@ class AztecToolbar : FrameLayout, IAztecToolbar, OnMenuItemClickListener { } KeyEvent.KEYCODE_I -> { if (event.isCtrlPressed) { // Italic = Ctrl + I - aztecToolbarListener?.onToolbarFormatButtonClicked(AztecTextFormat.FORMAT_ITALIC, true) + aztecToolbarListener?.onToolbarFormatButtonClicked(AztecTextFormat.FORMAT_EMPHASIS, true) findViewById(ToolbarAction.ITALIC.buttonId).performClick() return true } diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/ToolbarAction.kt b/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/ToolbarAction.kt index efaf18a29..db77d457a 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/ToolbarAction.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/toolbar/ToolbarAction.kt @@ -34,7 +34,7 @@ enum class ToolbarAction constructor(override val buttonId: Int, override val ac ITALIC( R.id.format_bar_button_italic, ToolbarActionType.INLINE_STYLE, - setOf(AztecTextFormat.FORMAT_ITALIC)), + setOf(AztecTextFormat.FORMAT_EMPHASIS, AztecTextFormat.FORMAT_ITALIC)), STRIKETHROUGH( R.id.format_bar_button_strikethrough, ToolbarActionType.INLINE_STYLE, diff --git a/aztec/src/test/kotlin/org/wordpress/aztec/AztecToolbarTest.kt b/aztec/src/test/kotlin/org/wordpress/aztec/AztecToolbarTest.kt index 0d0a3f8bd..3a7859413 100644 --- a/aztec/src/test/kotlin/org/wordpress/aztec/AztecToolbarTest.kt +++ b/aztec/src/test/kotlin/org/wordpress/aztec/AztecToolbarTest.kt @@ -136,7 +136,7 @@ class AztecToolbarTest { Assert.assertTrue(italicButton.isChecked) editText.append("italic") - Assert.assertEquals("italic", editText.toHtml()) + Assert.assertEquals("italic", editText.toHtml()) italicButton.performClick() Assert.assertFalse(italicButton.isChecked) } @@ -155,7 +155,7 @@ class AztecToolbarTest { editText.setSelection(0, editText.length()) italicButton.performClick() Assert.assertTrue(italicButton.isChecked) - Assert.assertEquals("italic", editText.toHtml()) + Assert.assertEquals("italic", editText.toHtml()) italicButton.performClick() Assert.assertFalse(italicButton.isChecked) @@ -268,21 +268,21 @@ class AztecToolbarTest { editText.append("Ita") italicButton.performClick() editText.append("lic") - Assert.assertEquals("BoldItalic", editText.toHtml()) + Assert.assertEquals("BoldItalic", editText.toHtml()) // Strike strikeThroughButton.performClick() editText.append("Str") strikeThroughButton.performClick() editText.append("ike") - Assert.assertEquals("BoldItalicStrike", editText.toHtml()) + Assert.assertEquals("BoldItalicStrike", editText.toHtml()) // Underline underlineButton.performClick() editText.append("Under") underlineButton.performClick() editText.append("line") - Assert.assertEquals("BoldItalicStrikeUnderline", editText.toHtml()) + Assert.assertEquals("BoldItalicStrikeUnderline", editText.toHtml()) // Clear text editText.setText("") @@ -299,21 +299,21 @@ class AztecToolbarTest { italicButton.performClick() editText.append("lic") italicButton.performClick() - Assert.assertEquals("BoldItalic", editText.toHtml()) + Assert.assertEquals("BoldItalic", editText.toHtml()) // Strike editText.append("Str") strikeThroughButton.performClick() editText.append("ike") strikeThroughButton.performClick() - Assert.assertEquals("BoldItalicStrike", editText.toHtml()) + Assert.assertEquals("BoldItalicStrike", editText.toHtml()) // Underline editText.append("Under") underlineButton.performClick() editText.append("line") underlineButton.performClick() - Assert.assertEquals("BoldItalicStrikeUnderline", editText.toHtml()) + Assert.assertEquals("BoldItalicStrikeUnderline", editText.toHtml()) } /** @@ -342,7 +342,7 @@ class AztecToolbarTest { editText.append("Ita") italicButton.performClick() editText.append("lic") - Assert.assertEquals(" Bold Italic", editText.toHtml()) + Assert.assertEquals(" Bold Italic", editText.toHtml()) // Space editText.append(" ") @@ -352,7 +352,7 @@ class AztecToolbarTest { editText.append("Str") strikeThroughButton.performClick() editText.append("ike") - Assert.assertEquals(" Bold Italic Strike", editText.toHtml()) + Assert.assertEquals(" Bold Italic Strike", editText.toHtml()) // Space editText.append(" ") @@ -362,7 +362,7 @@ class AztecToolbarTest { editText.append("Under") underlineButton.performClick() editText.append("line") - Assert.assertEquals(" Bold Italic Strike Underline", editText.toHtml()) + Assert.assertEquals(" Bold Italic Strike Underline", editText.toHtml()) } /** @@ -392,7 +392,7 @@ class AztecToolbarTest { italicButton.performClick() Assert.assertTrue(italicButton.isChecked) - Assert.assertEquals("bold bolditalic italic strike underline normal", editText.toHtml()) + Assert.assertEquals("bold bolditalic italic strike underline normal", editText.toHtml()) editText.setSelection(16, 22) @@ -407,14 +407,14 @@ class AztecToolbarTest { strikeThroughButton.performClick() Assert.assertTrue(strikeThroughButton.isChecked) - Assert.assertEquals("bold bolditalic italic strike underline normal", editText.toHtml()) + Assert.assertEquals("bold bolditalic italic strike underline normal", editText.toHtml()) editText.setSelection(30, 39) underlineButton.performClick() Assert.assertTrue(underlineButton.isChecked) - Assert.assertEquals("bold bolditalic italic strike underline normal", editText.toHtml()) + Assert.assertEquals("bold bolditalic italic strike underline normal", editText.toHtml()) } /** @@ -435,31 +435,31 @@ class AztecToolbarTest { italicButton.performClick() Assert.assertTrue(boldButton.isChecked) editText.append("bolditalic") - Assert.assertEquals("boldbolditalic", editText.toHtml()) + Assert.assertEquals("boldbolditalic", editText.toHtml()) boldButton.performClick() Assert.assertFalse(boldButton.isChecked) editText.append("italic") - Assert.assertEquals("boldbolditalicitalic", editText.toHtml()) + Assert.assertEquals("boldbolditalicitalic", editText.toHtml()) italicButton.performClick() Assert.assertFalse(italicButton.isChecked) strikeThroughButton.performClick() Assert.assertTrue(strikeThroughButton.isChecked) editText.append("strike") - Assert.assertEquals("boldbolditalicitalicstrike", editText.toHtml()) + Assert.assertEquals("boldbolditalicitalicstrike", editText.toHtml()) strikeThroughButton.performClick() Assert.assertFalse(strikeThroughButton.isChecked) underlineButton.performClick() Assert.assertTrue(underlineButton.isChecked) editText.append("underline") - Assert.assertEquals("boldbolditalicitalicstrikeunderline", editText.toHtml()) + Assert.assertEquals("boldbolditalicitalicstrikeunderline", editText.toHtml()) underlineButton.performClick() Assert.assertFalse(underlineButton.isChecked) editText.append("normal") - Assert.assertEquals("boldbolditalicitalicstrikeunderlinenormal", editText.toHtml()) + Assert.assertEquals("boldbolditalicitalicstrikeunderlinenormal", editText.toHtml()) } /** @@ -606,12 +606,12 @@ class AztecToolbarTest { @Test @Throws(Exception::class) fun extendStyleFromWholeSelection() { - editText.fromHtml("bolditalic") + editText.fromHtml("bolditalic") editText.setSelection(0, editText.length()) italicButton.performClick() - Assert.assertEquals("bolditalic", editText.toHtml()) + Assert.assertEquals("bolditalic", editText.toHtml()) } /** @@ -630,7 +630,7 @@ class AztecToolbarTest { Assert.assertEquals("bolditalic", editText.toHtml()) italicButton.performClick() - Assert.assertEquals("bolditalic", editText.toHtml()) + Assert.assertEquals("bolditalic", editText.toHtml()) italicButton.performClick() Assert.assertEquals("bolditalic", editText.toHtml()) @@ -679,13 +679,13 @@ class AztecToolbarTest { editText.setSelection(4, 8) italicButton.performClick() - Assert.assertEquals("
Div
Span
Hidden
", + Assert.assertEquals("
Div
Span
Hidden
", editText.toHtml()) editText.setSelection(9, 15) strikeThroughButton.performClick() - Assert.assertEquals("
Div
Span
Hidden
", + Assert.assertEquals("
Div
Span
Hidden
", editText.toHtml()) } From aedcb1fe35d8876311ef0447c038635a9a7bfab9 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 6 Feb 2019 17:57:14 +0200 Subject: [PATCH 7/8] Update the changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd78307eb..69ac9fe11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# Changelog +## [v1.3.19](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.19) +### Changed +- Support for `` for italic and using it as default via the formatting toolbar #777 + # Changelog ## [v1.3.18](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.18) ### Fixed From 40655b9c631fcec658246a5a0d99d2123f57c435 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Thu, 7 Feb 2019 12:18:31 +0200 Subject: [PATCH 8/8] Update connected tests for --- .../org/wordpress/aztec/demo/tests/FormattingHistoryTests.kt | 2 +- .../wordpress/aztec/demo/tests/MixedTextFormattingTests.kt | 2 +- .../wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/FormattingHistoryTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/FormattingHistoryTests.kt index abbdb744c..ea13de73e 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/FormattingHistoryTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/FormattingHistoryTests.kt @@ -187,7 +187,7 @@ class FormattingHistoryTests : BaseHistoryTest() { @Test fun testAddItalicAndUnderlineUndoRedo() { val text = "There's no crying in baseball!" - val htmlRegex = Regex("$text|$text") + val htmlRegex = Regex("$text|$text") val editorPage = EditorPage() // Insert text snippet diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt index e67a60095..a277e8fd9 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/MixedTextFormattingTests.kt @@ -22,7 +22,7 @@ class MixedTextFormattingTests : BaseTest() { val text1 = "so" val text2 = "me " val text3 = "text " - val regex = Regex("$text1$text2<(strong|i)><(strong|i)>$text3") + val regex = Regex("$text1$text2<(strong|em)><(strong|em)>$text3") EditorPage() .toggleBold() diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt index e7fd61ddb..170b35f49 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/SimpleTextFormattingTests.kt @@ -32,7 +32,7 @@ class SimpleTextFormattingTests : BaseTest() { fun testSimpleItalicFormatting() { val text1 = "some" val text2 = "text" - val html = "$text1$text2" + val html = "$text1$text2" EditorPage() .insertText(text1) @@ -335,7 +335,7 @@ class SimpleTextFormattingTests : BaseTest() { @Test fun testInlineStyleAndDelete() { val text1 = "some" - val html = "som" + val html = "som" EditorPage() .toggleItalics()