Skip to content

Commit 572d200

Browse files
committed
modified test and AztecParser to make <hr/> tag instead of <hr> in accordance to HTML and XHTML
1 parent 1f51c88 commit 572d200

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests/HistoryMixedTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class HistoryMixedTests : BaseHistoryTest() {
2424
"\t<li></li>\n" +
2525
"</ol>\n" +
2626
"\n" +
27-
"<hr>\n" +
27+
"<hr/>\n" +
2828
"\n" +
2929
"<ul>\n" +
3030
"\t<li>Unordered</li>\n" +

app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ open class MainActivity : AppCompatActivity(),
9191
private val UNDERLINE = "<u style=\"color:lime\">Underline</u><br>"
9292
private val STRIKETHROUGH = "<s style=\"color:#ff666666\" class=\"test\">Strikethrough</s><br>" // <s> or <strike> or <del>
9393
private val ORDERED = "<ol style=\"color:green\"><li>Ordered</li><li>should have color</li></ol>"
94-
private val LINE = "<hr>"
94+
private val LINE = "<hr/>"
9595
private val UNORDERED = "<ul><li style=\"color:darkred\">Unordered</li><li>Should not have color</li></ul>"
9696
private val QUOTE = "<blockquote>Quote</blockquote>"
9797
private val LINK = "<a href=\"https://github.com/wordpress-mobile/WordPress-Aztec-Android\">Link</a><br>"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ class AztecParser(val plugins: List<IAztecPlugin> = ArrayList()) {
473473
}
474474

475475
if (span is AztecHorizontalRuleSpan) {
476-
out.append("<${span.startTag}>")
476+
out.append("<${span.startTag}/>")
477477
i = next
478478
}
479479

aztec/src/test/kotlin/org/wordpress/aztec/AttributeTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class AttributeTest {
5252
private val BIG = "<big b=\"B\">Big</big>"
5353
private val SMALL = "<small s=\"S\">Small</small>"
5454
private val P = "<p p=\"P\">Paragraph</p>"
55-
private val LINE = "<hr h=\"H\">Ruler</hr>"
55+
private val LINE = "<hr h=\"H\"/>"
5656
private val MIXED = HEADING + BOLD + ITALIC + UNDERLINE + STRIKETHROUGH + ORDERED +
5757
UNORDERED + QUOTE + LINK + COMMENT + COMMENT_MORE + COMMENT_PAGE +
5858
UNKNOWN + LIST + SUB + SUP + FONT + TT + BIG + SMALL + P

aztec/src/test/kotlin/org/wordpress/aztec/AztecToolbarTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,11 +960,11 @@ class AztecToolbarTest {
960960
@Throws(Exception::class)
961961
fun orderedListMultiselectAlignment() {
962962
editText.fromHtml("<ol><li>item 1</li><li style=\"text-align: center;\">item 2</li></ol>" +
963-
"<hr><ol><li>item 3</li><li>item 4</li></ol>")
963+
"<hr/><ol><li>item 3</li><li>item 4</li></ol>")
964964

965965
editText.setSelection(editText.text.indexOf("2"), editText.text.indexOf("3"))
966966
alignRightButton.performClick()
967-
Assert.assertEquals("<ol><li>item 1</li><li style=\"text-align: right;\">item 2</li></ol><hr>" +
967+
Assert.assertEquals("<ol><li>item 1</li><li style=\"text-align: right;\">item 2</li></ol><hr/>" +
968968
"<ol><li style=\"text-align: right;\">item 3</li><li>item 4</li></ol>",
969969
editText.toHtml())
970970
}

aztec/src/test/kotlin/org/wordpress/aztec/ClipboardTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ClipboardTest {
2626
private val UNDERLINE = "<u>Underline</u><br>"
2727
private val STRIKETHROUGH = "<s class=\"test\">Strikethrough</s>" // <s> or <strike> or <del>
2828
private val ORDERED = "<ol><li>Ordered</li><li></li></ol>"
29-
private val LINE = "<hr>"
29+
private val LINE = "<hr/>"
3030
private val UNORDERED = "<ul><li>Unordered</li><li></li></ul>"
3131
private val QUOTE = "<blockquote>Quote</blockquote>"
3232
private val LINK = "<a href=\"https://github.com/wordpress-mobile/WordPress-Aztec-Android\">Link</a><br>"

0 commit comments

Comments
 (0)