|
36 | 36 | import android.text.style.ParagraphStyle;
|
37 | 37 | import android.text.style.QuoteSpan;
|
38 | 38 | import android.text.style.RelativeSizeSpan;
|
| 39 | +import android.text.style.StrikethroughSpan; |
39 | 40 | import android.text.style.StyleSpan;
|
40 | 41 | import android.text.style.SubscriptSpan;
|
41 | 42 | import android.text.style.SuperscriptSpan;
|
@@ -525,6 +526,12 @@ private void handleStartTag(String tag, Attributes attributes) {
|
525 | 526 | start(mSpannableStringBuilder, new InlineCode());
|
526 | 527 | } else if (tag.equalsIgnoreCase("pre")) {
|
527 | 528 | start(mSpannableStringBuilder, new CodeBlock());
|
| 529 | + } else if (tag.equalsIgnoreCase("del")) { |
| 530 | + start(mSpannableStringBuilder, new StrikeThrough()); |
| 531 | + } else if (tag.equalsIgnoreCase("s")) { |
| 532 | + start(mSpannableStringBuilder, new StrikeThrough()); |
| 533 | + } else if (tag.equalsIgnoreCase("strike")) { |
| 534 | + start(mSpannableStringBuilder, new StrikeThrough()); |
528 | 535 | } else if (tag.length() == 2
|
529 | 536 | && Character.toLowerCase(tag.charAt(0)) == 'h'
|
530 | 537 | && tag.charAt(1) >= '1' && tag.charAt(1) <= '6') {
|
@@ -599,6 +606,12 @@ private void handleEndTag(String tag) {
|
599 | 606 | } else if (tag.equalsIgnoreCase("pre")) {
|
600 | 607 | end(mSpannableStringBuilder, CodeBlock.class, new TypefaceSpan(
|
601 | 608 | MONOSPACE));
|
| 609 | + } else if (tag.equalsIgnoreCase("del")) { |
| 610 | + end(mSpannableStringBuilder, StrikeThrough.class, new StrikethroughSpan()); |
| 611 | + } else if (tag.equalsIgnoreCase("s")) { |
| 612 | + end(mSpannableStringBuilder, StrikeThrough.class, new StrikethroughSpan()); |
| 613 | + } else if (tag.equalsIgnoreCase("strike")) { |
| 614 | + end(mSpannableStringBuilder, StrikeThrough.class, new StrikethroughSpan()); |
602 | 615 | } else if (tag.length() == 2
|
603 | 616 | && Character.toLowerCase(tag.charAt(0)) == 'h'
|
604 | 617 | && tag.charAt(1) >= '1' && tag.charAt(1) <= '6') {
|
@@ -718,6 +731,9 @@ private static class InlineCode {
|
718 | 731 | private static class CodeBlock {
|
719 | 732 | }
|
720 | 733 |
|
| 734 | + private static class StrikeThrough { |
| 735 | + } |
| 736 | + |
721 | 737 | private static class Font {
|
722 | 738 | public String mColor;
|
723 | 739 | public String mFace;
|
|
0 commit comments