Skip to content

Commit c562813

Browse files
committed
Remove commented code
1 parent 0716c7a commit c562813

File tree

5 files changed

+1
-31
lines changed

5 files changed

+1
-31
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -997,10 +997,6 @@ class AztecText : android.support.v7.widget.AppCompatEditText, TextWatcher, Unkn
997997
}
998998

999999
override fun deleteSurroundingText(beforeLength: Int, afterLength: Int): Boolean {
1000-
// if (beforeLength == 1 && afterLength == 0) {
1001-
// return sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)) && sendKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL))
1002-
// }
1003-
10041000
return super.deleteSurroundingText(beforeLength, afterLength)
10051001
}
10061002
}

aztec/src/main/kotlin/org/wordpress/aztec/formatting/BlockFormatter.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,7 @@ class BlockFormatter(editor: AztecText, val listStyle: ListStyle, val quoteStyle
398398
}
399399

400400
applyBlock(spanToApply, startOfBlock, endOfBlock)
401-
402-
//if the line was empty trigger onSelectionChanged manually to update toolbar buttons status
403-
// if (isEmptyLine) {
404-
editor.onSelectionChanged(startOfLine, endOfLine)
405-
// }
401+
editor.onSelectionChanged(startOfLine, endOfLine)
406402
}
407403
}
408404

aztec/src/main/kotlin/org/wordpress/aztec/formatting/InlineFormatter.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ class InlineFormatter(editor: AztecText, val codeStyle: CodeStyle) : AztecFormat
232232
//special check for StyleSpan
233233
if (firstSpan is StyleSpan && secondSpan is StyleSpan) {
234234
return firstSpan.style == secondSpan.style
235-
// } else if (firstSpan is AztecHeadingSpan && secondSpan is AztecHeadingSpan) {
236-
// return firstSpan.heading == secondSpan.heading
237235
} else {
238236
return true
239237
}

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ object Format {
107107
// Pretty it up for the source editor
108108
val blocklist = "blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset"
109109
val blocklist1 = blocklist + "|div|p"
110-
// val blocklist2 = blocklist + "|pre"
111110

112111
content = replaceAll(content, "\\s*</($blocklist1)>\\s*", "</$1>\n")
113112
content = replaceAll(content, "\\s*<((?:$blocklist1)(?: [^>]*)?)>", "\n<$1>")
@@ -127,15 +126,11 @@ object Format {
127126
content = replaceAll(content, "(?i)\\s*<br ?/?>\\s*", "\n")
128127

129128
// Fix some block element newline issues
130-
// content = replaceAll(content, "\\s*<div", "\n<div")
131129
content = replaceAll(content, "\n\n<div", "\n<div")
132130
content = replaceAll(content, "</div>\n\n", "</div>\n")
133131
content = replaceAll(content, "(?i)\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*", "\n\n[caption$1[/caption]\n\n")
134132
content = replaceAll(content, "caption\\]\\n\\n+\\[caption", "caption]\n\n[caption")
135133

136-
// content = replaceAll(content, "\\s*<((?:$blocklist2)(?: [^>]*)?)\\s*>", "\n<$1>")
137-
// content = replaceAll(content, "\\s*</($blocklist2)>\\s*", "</$1>\n")
138-
139134
content = replaceAll(content, "<li([^>]*)>", "\t<li$1>")
140135

141136
if (content.contains("<option")) {
@@ -279,27 +274,14 @@ object Format {
279274
html = replaceAll(html, "(?i)<p>\\s*(</?(?:div)(?: [^>]*)?>)", "$1<p>")
280275
html = replaceAll(html, "(?i)(</?(?:div)(?: [^>]*)?>)\\s*</p>", "</p>$1")
281276

282-
// html = replaceAll(html, "(?i)<p>\\s*(<!--(.*?)-->)", "$1")
283-
// html = replaceAll(html, "(?i)(<!--(.*?)-->)\\s*</p>", "$1")
284-
285277
html = replaceAll(html, "(?i)<p>\\s*(</?(?:$blocklist)(?: [^>]*)?>)", "$1")
286278
html = replaceAll(html, "(?i)(</?(?:$blocklist)(?: [^>]*)?>)\\s*</p>", "$1")
287279
html = replaceAll(html, "(?i)\\s*\\n", "<br>\n")
288280
html = replaceAll(html, "(?i)(</?(?:$blocklist)[^>]*>)\\s*<br ?/?>", "$1")
289281

290-
// html = replaceAll(html, "(?i)(<!--(.*?)-->)\\s*<br ?/?>", "$1")
291-
292282
html = replaceAll(html, "(?i)<br ?/?>(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)", "$1")
293283
html = replaceAll(html, "(?i)(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*", "[caption$1[/caption]")
294284

295-
// html = html.replace(Regex("(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)</p>"), { matchResult: MatchResult ->
296-
// if (matchResult.groupValues[2].matches(Regex("<p( [^>]*)?>"))) {
297-
// matchResult.groupValues[0]
298-
// } else {
299-
// matchResult.groupValues[1] + "<p>" + matchResult.groupValues[2] + "</p>"
300-
// }
301-
// })
302-
303285
// put back the line breaks in pre|script
304286
if (preserve_linebreaks) {
305287
html = replaceAll(html, "<wp-line-break>", "<br>")

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ class CalypsoFormattingTest : AndroidTestCase() {
7676
"<div class=\"fourth\"><u>Under</u>line</div>\n" +
7777
"<div class=\"fifth\"></div>\n</div>\n</div>"
7878

79-
// private val FORMATTED_COMPLEX_HTML =
80-
8179
/**
8280
* Initialize variables.
8381
*/

0 commit comments

Comments
 (0)